Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Hi 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 oob 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

share|improve this question
    
Ever found a way? –  David Sep 5 '13 at 8:20
    
dont think so sorry, but if you find one please post it here :) –  Sebastien Stettler Sep 5 '13 at 10:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.