Search
DiagramBase.ExpandButtonClicked Event
See Also
 





Raised when the user clicks the [±] button of an Expandable node.

Namespace: MindFusion.Diagramming.Wpf
Assembly: MindFusion.Diagramming.Wpf

 Syntax

C#  Copy Code

public event EventHandler<NodeEventArgs> ExpandButtonClicked

Visual Basic  Copy Code

Public Event ExpandButtonClicked As EventHandler(Of NodeEventArgs)

 Event Data

ExpandButtonClicked event handlers receive an argument of type NodeEventArgs. The following NodeEventArgs members provide information relevant to the event:

Member name

Description

Node

The DiagramNode whose [±] button has been clicked.

 Remarks

This event is raised only if ExpandButtonAction is set to RaiseEvents. Otherwise either the TreeCollapsed or TreeExpanded event is raised, depending on the state of the node.

 Example

The following sample code hides or shows all subordinated nodes in a group when the master node's [±] button is clicked:

C#  Copy Code
void diagram_ExpandButtonClicked(object sender, NodeEventArgs e)
{          
    if (e.Node.SubordinateGroup != null)
    {
        foreach (DiagramItem item in e.Node.SubordinateGroup.AttachedNodes)
            item.Visible = e.Node.Expanded;
    }
}
Visual Basic  Copy Code

Sub diagram_ExpandButtonClicked(ByVal sender As Object, ByVal e As NodeEventArgs) Handles diagram.ExpandButtonClicked

    If Not e.Node.SubordinateGroup Is Nothing Then

        Dim item As DiagramItem
        For Each item In e.Node.SubordinateGroup.AttachedNodes
            item.Visible = e.Node.Expanded
        Next

    End If

End Sub

 See Also