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) ...

Get Microsoft Windows Workflow Foundation 4.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.