ActivityDesigner.Verbs Property


Gets the collection of verbs to be associated with the designer.

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

protected virtual ActivityDesignerVerbCollection Verbs { get; }

Property Value

Type: System.Workflow.ComponentModel.Design.ActivityDesignerVerbCollection

The collection of verbs to be associated with the designer.

Use the Verbs method to determine the verbs to show on the Context Menu.

The following example demonstrates how to override the Verbs property to insert custom verb actions for a ActivityPreviewDesigner. The CreateActivityVerbs creates a new ActivityDesignerVerb named "Add New Parallel Branch" and associates an event handler named OnAddParallelBranch. When the verb is clicked in the workflow designer, the event handler is called.

private ActivityDesignerVerbCollection verbs = null;

protected override ActivityDesignerVerbCollection Verbs
        if (this.verbs == null)

        return this.verbs;

private void CreateActivityVerbs()
    this.verbs = new ActivityDesignerVerbCollection();

    ActivityDesignerVerb addBranchVerb = new ActivityDesignerVerb(this,
        DesignerVerbGroup.View, "Add New Parallel Branch", new EventHandler(OnAddParallelBranch));


protected void OnAddParallelBranch(object sender, EventArgs e)
    // Code for adding a new branch to the parallel activity goes here

.NET Framework
Available since 3.0
Return to top