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

Loading up a WF program from an XAML file

In this task, we will run a WF program by loading it from an XAML file.

How to do it...

  1. Create a workflow project:

    Create a new Workflow Console Application under the Chapter01 solution and name the project as LoadUpWorkflowFromXML.

  2. Author a workflow:

    Author the Workflow1.xaml file; this workflow will print a string to console as shown in the following screenshot:

    How to do it...
  3. Create code to load up the workflow instance from an XAML string:

    Open Program.cs file and change code as follow:

    using System; using System.Activities; using System.Activities.Statements; using System.IO; using System.Collections; using System.Text; ...

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