Binding output of Custom Activity designer to activity argument

Posted by gbanfill on Stack Overflow See other posts from Stack Overflow or by gbanfill
Published on 2010-04-26T12:23:07Z Indexed on 2010/06/02 15:13 UTC
Read the original article Hit count: 323

I am trying to add a custom activity designer for an activity that I have. The activity looks a little like:

public class WaitForUserInputActvitiy : NativeActivity
{
    public InArgument<UserInteractionProperty[]> UserInteraction { get; set; }
}

I am trying to put a designer on the activity to make it a bit nicer to set these values (so you don't end up typing VB in directly. My designer is based on mindscape property grid. I have an ObservableDictionary source that I want to get the values from and put them in to the InArgument. Currently I am using

 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();
    }
}

However this results in an ArgumentException "Object of type UserInteractionProperty[] cannot be converted to InArgument`1[UserInteractionProperty[]].

So how do I convert my array of UserInteractionProperties into an InArgument?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about Workflow