Code Activity context menu questions
On the code activity context menu, two of the selections are:
Promote Bindable Properties
and
Bind Property 'ExecuteCode' (assuming that I placed a value into the Executecode property and created a handler).
I'd like to have a better understanding of what these menu selections do. For example, why would a code activity, from the toolbox, have a bindable property? Wouldn't that have to be a custom activity with a dependency property I created?
And why would I bind my ExecuteCode method to a property?
Thanks.
Property promotion applies equally to the built-in activities as well as your own custom activities.
You are correct that DependencyProperty is the key to the designer knowing what properties to "promote". Thus because ExecuteCode is a dependencyproperty on CodeActivity - the designer gives you these options.
The concept of property promotion in general is that you may have a child activity that has a property which you may want to connected to properties on the parent. Property promotion creates a connection between a new property on the parent - and the property on the child.
So then, in the case of the Code activity directly off of the toolbox, would there be any reason that you would want to promote the ExecuteCode property? For example, if I promoted the ExecuteCode property and this property is tied to a method called SetStatus, then from somewhere within the workflow itself could I call back into this SetStatus method?
That example probably doesn't make any sense, but I can see why you would want this on a custom activity, just not a canned one.
Thanks!
Hi. I am trying get this to work but it won't.
First I have a workflow which runs the ExecuteCode activity. I promoted the bindable properties of the execute code - that worked fine. But when I wrapped the Workflow I created in an Invokeworkflow activity I had no access to the ExecuteCode activity.
Am I doing something wrong?