Attached Properties in Windows Workflow Foundation 4.0?

Is attached property supported in Windows Workflow Foundation 4?

If not, how are common scenarios related to attached properties ("arbitrary parent-to-child property") supported in Windows Workflow Foundation 4?

+2


source to share


3 answers


No, and yes. Compared to WF 3. *, this is completely different.

Attached properties are not available by default for any of the Activity classes in System.Activities. The System.Activity and itse subclasses do not implement DependencyObject and do not allow WPF related properties to be set in the same way that workflow 3. * classes did.

However, attached properties are maintained at design time in Workflow Designer (reuse or in Visual Studio). When you load the XAML file of an activity, the Activites in the XAML file are loaded into ModelItems. ModelItem also does not implement DependencyObject, however there is a design-time service that allows you to add AttachedProperties to model items based on the underlyinng object class: this is AttachedPropertiesService (derived from EditingContext.Services). [I don't remember if these attached properties were automatically serialized for XAML.]



Together with AttachedPropertiesService, the ViewStateService is also used for scenarios where design-time data needs to be bound to an object and serialized into XAML, such as defining a flowchart layout node.

(PS Other posters are also correct that variables and arguments are used to pass data to / from operations, but I'm not sure how this relates to the occurrence of arbitrary values.)

+5


source


In wf4, you use a variable to store data and In / OutArgument to define input and output for actions. The story is completely different, basically forget everything you know about wf3 since wf4.



+1


source


yes .. use Variables and InArgument ... Forget about dependency properties in 3.0 / 3.5.

take a look at this example.

http://pavkata.blogspot.com/2008/11/workflow-foundation-40.html

0


source







All Articles