WorkflowView.WorkflowView(IServiceProvider) Constructor

Initializes an instance of a WorkflowView with the specified service provider.

Namespace: System.Workflow.ComponentModel.Design
Assembly: System.Workflow.ComponentModel (in system.workflow.componentmodel.dll)

public WorkflowView (
	IServiceProvider serviceProvider
public WorkflowView (
	IServiceProvider serviceProvider
public function WorkflowView (
	serviceProvider : IServiceProvider
Not applicable.



An object that implements the IServiceProvider interface.

The following example shows how to create a WorkflowView object. In this example, a new DesignSurface object is created and the BeginLoad method is called passing a WorkflowDesignerLoader object as the parameter. After creating a new SequentialWorkflowActivity, a WorkflowView object is created using the DesignSurface created earlier as a parameter to the constructor.

This code example is part of the Outlook Workflow Wizard SDK Sample from the WorkflowViewWrapper.cs file. For more information, see Outlook Workflow Wizard Sample.

this.loader = new Loader();

// Create a Workflow Design Surface
this.surface = new DesignSurface();

// Get the Workflow Designer Host
this.Host = this.surface.GetService(typeof(IDesignerHost)) as IDesignerHost;

if (this.Host == null)

// Create a Sequential Workflow by using the Workflow Designer Host
SequentialWorkflow = (SequentialWorkflowActivity)Host.CreateComponent(typeof(SequentialWorkflowActivity));
SequentialWorkflow.Name = "CustomOutlookWorkflow";

// Create a Workflow View on the Workflow Design Surface
this.workflowView = new WorkflowView(this.surface as IServiceProvider);

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions