2

I am currently building a custom workflow activity for Visual Studio 2010.

I would like to create a method invoking property, like many of the ootb activities have:

        public static DependencyProperty WebNameProperty = DependencyProperty.Register("WebName", typeof(string), typeof(ListIteratorActivity));

    [Category("Cross-Site Actions"), Browsable(true)]
    [DesignerSerializationVisibility
      (DesignerSerializationVisibility.Visible)]
    public string WebName
    {
        get
        {
            return Convert.ToString(base.GetValue(FirstNameProperty));
        }
        set
        {
            base.SetValue(FirstNameProperty, value);
        }
    }

Above is an example of a method accepting a string, how do I make a property to accept a method?

UPDATE

When I try

        public static DependencyProperty MethodInvokingProperty = DependencyProperty.Register("MethodInvoking", typeof(Delegate), typeof(ListIteratorActivity));

    [Category("Cross-Site Actions"), Browsable(true)]
    [DesignerSerializationVisibility
      (DesignerSerializationVisibility.Visible)]
    public Delegate MethodInvoking
    {
        get
        {
            return (Delegate)base.GetValue(MethodInvokingProperty);
        }
        set
        {
            base.SetValue(MethodInvokingProperty, value);
        }
    }

it throws an error of

Error 1 Could not create activity of type 'HumanResources.ListIteratorActivity'. System.ArgumentException: Type 'HumanResources.ListIteratorActivity' does not define a static dependency event with name 'MethodInvokingEvent'. Parameter name: ownerType at System.Workflow.ComponentModel.DependencyProperty.ValidateAndRegister(String name, Type propertyType, Type ownerType, PropertyMetadata defaultMetadata, Type validatorType, Boolean isRegistered) at System.Workflow.ComponentModel.DependencyProperty.Register(String name, Type propertyType, Type ownerType) at HumanResources.ListIteratorActivity..cctor() C:\Users\sebastiens\Documents\Visual Studio 2010\Projects\Quarphix\HumanResources 1 1

2
  • Ever found a way?
    – David
    Commented Sep 5, 2013 at 8:20
  • dont think so sorry, but if you find one please post it here :) Commented Sep 5, 2013 at 10:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.