views:

94

answers:

1

In .NET Workflow Foundation, there are three kinds of dependency proprieties: instance properties, meta properties, and attached properties. Can someone explain what the difference and proper usages are? Thanks.

+1  A: 

Basically the difference is this:

Instance properties. They appear like regular properties at first glance from the outside but don't use their own backing storage and lave that up to the WF runtime. Because of this they allow for property binding where you basically have multiple properties use the same backing store. Very handy because it saves code like Activity2.Input = Activity1.Output, just bind the two together and the runtime does all the work. Basically these are your regular WF properties holding data the activities work on.

Meta properties are similar except you can only set them at design time. The Enabled property is an example as you cannot change it at runtime. You typically use this wherever you have a property that controls an activity behavior that you want fixed at runtime.

Attached properties are properties one activity can attach to another activity. These result in those properties that only appear if an activity is used in a specific place. Not something used very often and only for very specific purposes.

Maurice