![](/img/trans.png)
[英]Workflow Foundation - Activity: Is it possible to cast a OutArgument?
[英]take the value of outArgument in activity to another activity
通過這個: http://msdn.microsoft.com/en-us/library/dd489442.aspx但我使用 XAML 文件制作工作流程的唯一不同之處。
我有一個問題:我需要將從用戶那里獲得的價值傳遞給另一個活動。 我嘗試創建一個變量(例如輸出)並分配該值,但另一個活動將其視為空。 當前活動完成后,它可能會失效或重置為默認值。
我嘗試使用 OutArgument,但它在 app.run 出現運行時錯誤,如下所示
“處理工作流樹時遇到以下錯誤:'workflow1':活動'1:workflow1'的私有實現具有以下驗證錯誤:未提供所需活動參數'Out_arg'的值。” 並且也沒有像第一個案例那樣在下一個活動中看到它。
[RequiredArgument]
public OutArgument<string> Out_arg { get; set; }
void OnBookmarkCallback(NativeActivityContext context, Bookmark bookmark, object val)
{
Console.WriteLine("im in resume ");
Console.WriteLine("bookmark1 Name is {0}", (string)val);
// for the first option that i tried
output = (string)val;
//then i tried
Out_arg.Set(context, (string)val);
XMAL文件:false 270,2.5 60,75 300,77.5 300,107.5 300,129.5 194.5,129.5 211,61 300,190.5 300,220.5 300,220.5 300,279 200,279 200,279 200,279 200,300,301 300,301 300,331 280,5,339.5,339.5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,3895,5,5,5,5,3895,5,5,5,5,389 d15,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,38 lid y.5 yr
你能幫我嗎?
您是否在工作流程中創建了變量並將 Out_arg 分配給它?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.