CompositeActivityDesigner.Expanded Property

 

Gets or sets a value that indicates whether the CompositeActivityDesigner is expanded.

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

public virtual bool Expanded { get; set; }

Property Value

Type: System.Boolean

true if the CompositeActivityDesigner is expanded; otherwise false.

In combination with OnMouseDown and ExpandButtonRectangle, use Expanded to determine the proper action when a user clicks the expand or collapse button on the CompositeActivityDesigner.

The following code example demonstrates how you can set the Expanded property based on a Boolean value passed as an argument to a method.

This code example is part of the Workflow Monitor SDK sample from the ViewHost.cs file. For more information, see Workflow Monitor.

internal void Expand(bool expand)
{
    IDesignerHost host = GetService(typeof(IDesignerHost)) as IDesignerHost;
    if (host == null)
        return;

    this.SuspendLayout();

    CompositeActivity root = host.RootComponent as CompositeActivity;
    foreach (Activity activity in root.Activities)
    {
        CompositeActivityDesigner compositeActivityDesigner = host.GetDesigner((IComponent)activity) as CompositeActivityDesigner;
        if (compositeActivityDesigner != null)
        {
            compositeActivityDesigner.Expanded = expand;
        }
    }

    this.ResumeLayout(true);
}

.NET Framework
Available since 3.0
Return to top
Show: