In this task, our workflow designer will have the ability to run workflow so that we can test our workflow when we are editing.
Before we begin this task, we must have completed the previous task: Implementing Save and Save As events.
Open the workflow designer project:
Open the workflow designer project we created in the previous task.
Open the designer's backend CS code file,
MainWindow.xaml.cs
, and create a new methodGetActivity
. Then add code to theTabItem_GotFocus_RefreshXamlBox
method and theMenuItem_Click_RunWorkflow
method:Activity GetActivity() { wd.Flush(); System.IO.StringReaderstringReader = new System. IO.StringReader(wd.Text); Activity root = System.Activities.XamlIntegration. ActivityXamlServices.Load(stringReader) as Activity; return root; } private void MenuItem_Click_RunWorkflow(object sender, RoutedEventArgs e) { Save(); Activity activity = GetActivity(); WorkflowApplicationwfApp...