c# - Add variables in designer for NativeActivity<T> in wf4 -


i have class extending nativeactivity

i want allow adding variables scope of activity designer. how can modify code of activity designer let me add variables?

no option add variables in custom activity through designer

my code

public class myactivity : nativeactivity<bool> {     public inargument<string> someinarg { get; set; }      public inargument<object> refinarg { get; set; }      public workflowdatacontext data { get; set; }      public collection<variable> variables { get; set; }      protected override void execute(nativeactivitycontext context)     {         result.set(context, true);     } } 

thanks.

surprising enough, adding getter returns empty collection - solves problem. suspect designer tries somehow access variables collection , when null returned - gives no option set variables in designer.

    public collection<variable> variables { get; } = new collection<variable>(); 

but attempt access variables results in

activity '1.1: myactivity' cannot access variable  because declared @ scope of activity '1.1: myactivity'.   activity can access own implementation variables. 

Comments