WorkflowView.RootDesigner Property

Definition

Gets or sets the root designer for the WorkflowView.

C#
public System.Workflow.ComponentModel.Design.ActivityDesigner RootDesigner { get; set; }

Property Value

The ActivityDesigner associated with the WorkflowView.

Examples

The following example shows how to retrieve the RootDesigner of a WorkflowView object. The workflowPanel field contains a method named GetWorkflowView that returns the active WorkflowView instance. The RootDesigner is then cast to a SequentialWorkflowRootDesigner before any action is taken on it.

This code example is part of the Basic DesignerHosting SDK Sample from the DesignerShell.cs file. For more information, see Basic Designer Hosting Sample.

C#
private void addButton_Click(object sender, EventArgs e)
{
    SequentialWorkflowRootDesigner rootDesigner = this.workflowPanel.GetWorkflowView().RootDesigner as SequentialWorkflowRootDesigner;
    int viewId = rootDesigner.ActiveView.ViewId;
    if (viewId == 1)
    {
        this.workflowPanel.OnCodeActivityAdded();
    }
    else
    {
        DialogResult resultBox = MessageBox.Show("This sample supports adding a code activity only in workflow view");
    }
}

Remarks

The root designer of the workflow is the designer associated with the design surface of the workflow. It contains all child designers, and subsequently all activities in the workflow.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1