O'Reilly logo

Microsoft Windows Workflow Foundation 4.0 Cookbook by Andrew Zhu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Converting a WF program instance to XAML

In real applications, we would like to write and test WF programs in imperative code, while storing, running, and transmitting workflow as an XAML string or file. In this task, we will convert a WF program instance to an XAML string.

How to do it...

  1. Create a workflow project:

    Create a new Workflow Console Application under the Chapter01 solution and name the project ConvertWFInstanceToXML. Delete the Workflow1.xaml file that is created by default.

  2. Write code to create the workflow and its host:

    Open Program.cs file and change the code as follows:

    using System; using System.Activities; using System.Activities.Statements; using System.Text; using System.Xaml; using System.Activities.XamlIntegration; using System.IO; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required