Download workflow stored in XAML in .NET 4.0

What is the syntax for loading the .NET 4.0 Beta2 workflow that was previously created and saved as XAML.

The WorkflowElement and WorkflowXamlServices classes no longer exist. I am trying to do something like this (which worked in Beta 1):

WorkflowElement wf = WorkflowXamlServices.Load(File.OpenRead("Workflow.xaml")) as WorkflowElement; 
+6
c # workflow workflow-foundation-4
source share
1 answer

Found my own answer after further research.

The WorkflowElement and WorkflowXamlServices classes have been removed from Beta2. The above approach requires the use of DynamicActivity and ActivityXamlServices.

 DynamicActivity wf = ActivityXamlServices.Load("Workflow.xaml") as DynamicActivity; 
+9
source share

All Articles