Export (0) Print
Expand All

InstanceDependencyProperty Class

Enables property sharing by the executing instances of an activity.


Namespace:  Microsoft.Rtc.Workflow.Activities
Assembly:  Microsoft.Rtc.Workflow (in Microsoft.Rtc.Workflow.dll)

public sealed class InstanceDependencyProperty

When an activity runs, a new instance may be created. Using an InstanceDependencyProperty ensures that the value of a property that is changed on the new instance will be kept in sync with the value of the property on the original activity. InstanceDependencyProperties are registered in the same way DependencyProperties are. An example is as follows:

The property is associated with the GetAndConfirm class, is of type TimeSpan and has a default value of Globals.DefaultIncompleteTimeout. The GetAndConfirm class must contain a (normal .Net) property called IncompleteTimeout. This property stores and retrieves values from the InstanceDependencyProperty as follows:

Objects associated with an InstanceDependencyProperty (in the example above GetAndConfirm) must implement the IInstanceDependencyObject interface.

Using a default value negatively impacts performance. The value will be cloned before being used. The cloning process is usually slow. If you are sure that the property will be used (and that the cloning will take place), it is better to use SetValue to set the value. The value can then be retrieved without cloning.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2015 Microsoft