Is there support for attached properties in WF4?
If not, how are scenarios common to attached properties ("arbitrary property of parent associated with children") supported in WF4?
Is there support for attached properties in WF4?
If not, how are scenarios common to attached properties ("arbitrary property of parent associated with children") supported in WF4?
In wf4 you use Variable to hold data and In/OutArgument to define input and output for activities. The story is completely different, basically forget all you know about wf3 when starting with wf4.
yes.. use Variables and InArgument... Forget about Dependency properties in 3.0 / 3.5.
have a look at this example..
http://pavkata.blogspot.com/2008/11/workflow-foundation-40.html
No, and also yes. Compared to WF 3.* it is quite different.
Attached properties are not available by default on any of the Activity classes in System.Activities. System.Activity and itse subclasses do not implement DependencyObject, and do not allow WPF attached properties to be set on them in the way 3.* workflow classes did.
However, attached properties are supported at design time within the Workflow Designer (rehosted or in Visual Studio). When you load an activity XAML file, the Activites in the XAML file are loaded wrapped in ModelItems. ModelItem does not implement DependencyObject either, however, there is a design time service which allows you to add AttachedProperties to model items based on the class of the underlyinng object: this is the AttachedPropertiesService (reached from EditingContext.Services). [I can't remember whether these attached properties are serialized to XAML automatically.]
Along with AttachedPropertiesService, ViewStateService is also used for scenarios where design-time data is to be attached to an object, and serialized in XAML, such as specifying flowchart node placement.
(P.S. Other posters are also right that Variables and Arguments are used for passing data to/from activities, but I'm not sure how that addresses the attaching arbitrary values issue.)