Numpty question first:

Is dependencyproperty binding to a workflow bi-directional, such that when an ectivity initialises it get the values set from the workflow properties, and then when it completes (closes ) th workflow gets the values set from those of the activity

how is this controlled what if there are parellel executing activities

Slightly non-numpty question:

I can define a readonly dependencyproperty using

DependencyPropertyOptions.ReadOnly

but the binding dialog doesnt like this and gives an error.

I want the property value to be readonly on an activity, how do I do this




Re: Windows Workflow Foundation Property Binding: its not clear whether its bi-directional, and can I define a readonly dependencyproperty

Tom Lake - MSFT

DependencyProperty binding is bi-directional in the sense that you are linking a property to where its value can be retrieved from and any new value that is set on it gets stored. If two activities are both bound to the same variable / property the current value will always be the last one to set it. It is no different than a class level variable being set by multiple code paths, the last one wins.

Binding one property to another is the same a setting a property so if a property is readonly then you can't bind it to anything. Other activities can bind their properties to it but if you attempt to set those properties you will get an InvalidOperationException with the message "Cannot set value to read only field 'SomeReadOnlyPropertyName' referred to in binding." How did you get the bind dialog to show up






Re: Windows Workflow Foundation Property Binding: its not clear whether its bi-directional, and can I define a readonly dependencyproperty

DavidR100

I set a custom activity property to be ReadOnly, then clicked the ... to bind. Thats all I think.

I guess it doesnt really matter as I could ignore any sets of the property value, but to be able to define a property as readonly would make more logical sense in many cases, eg a custom activity that calculates the VAT, clearly its non-sensical to have that property set by the Workflow, evern tho it doesnt do any real harm in this case.