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

Implementing Save and Save As events

In this task, we will give our workflow designer the ability to save workflow into an XAML file.

Getting ready

Before we begin this task, we must complete the previous task: Implementing New Workflow and Load Workflow events.

How to do it...

  1. Open the workflow designer project:

    Open the workflow designer project we created in the previous task.

  2. Add code to the designer:

    Open the designer's backend CS code file and add code for the following three methods: Save method, MenuItem_Click_Save method, and MenuItem_Click_SaveAs method:

    private void Save() { if (workflowFilePathName == "temp.xaml") { Microsoft.Win32.SaveFileDialog saveFileDialog =new Microsoft.Win32.SaveFileDialog(); if (saveFileDialog.ShowDialog(this).Value) ...

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