【发布时间】:2010-04-26 12:23:07
【问题描述】:
我正在尝试为我拥有的活动添加自定义活动设计器。活动看起来有点像:
public class WaitForUserInputActvitiy : NativeActivity
{
public InArgument<UserInteractionProperty[]> UserInteraction { get; set; }
}
我正在尝试在活动中设置一个设计器,以便更好地设置这些值(因此您最终不会直接输入 VB。我的设计器基于 mindscape 属性网格。我有一个 ObservableDictionary 源我想从中获取值并将它们放入 InArgument。目前我正在使用
private void TestGrid_LostFocus(object sender, RoutedEventArgs e)
{
using (ModelEditingScope editingScope = this.ModelItem.BeginEdit())
{
Argument myArg = Argument.Create(typeof(WaitForUserInputActvitiy), ArgumentDirection.In);
this.ModelItem.Properties["UserInteraction"].SetValue(source.Values.ToArray());
editingScope.Complete();
}
}
但是,这会导致 ArgumentException“UserInteractionProperty[] 类型的对象无法转换为 InArgument`1[UserInteractionProperty[]]。
那么如何将我的 UserInteractionProperties 数组转换为 InArgument?
【问题讨论】:
标签: wpf workflow workflow-foundation-4 custom-activity