Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loading a workflow stored as XAML in .NET 4.0

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

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

WorkflowElement wf = WorkflowXamlServices.Load(File.OpenRead("Workflow.xaml")) as WorkflowElement;
like image 836
martyk Avatar asked Oct 31 '09 15:10

martyk


1 Answers

Found my own answer after further research.

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

DynamicActivity wf = ActivityXamlServices.Load("Workflow.xaml") as DynamicActivity;
like image 51
martyk Avatar answered Sep 28 '22 06:09

martyk