Class DiagramExpandIcon
Represents the expand icon used to indicate the expandable state of a node in a diagram component.
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class DiagramExpandIcon : DiagramIcon, IDiagramObject, ICloneable
Remarks
The DiagramExpandIcon class provides a model for configuring the visual representation and behavior of the expand icon on a diagram node. This icon is typically used to toggle the visibility of child nodes by expanding or collapsing them within a diagram structure.
Examples
This example demonstrates how to configure and use an expand icon within a Node in SfDiagramComponent.
<SfDiagramComponent Height="600px" Nodes="@nodes" />
@code {
// Initialize the node collection with a node that has Expand & Collapse icons
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
protected override void OnInitialized()
{
Node node = new Node()
{
ID = "node1",
// Size of the node
Height = 100,
Width = 100,
// Position of the node
OffsetX = 100,
OffsetY = 100,
ExpandIcon = new DiagramExpandIcon()
{
Shape = DiagramExpandIcons.Minus,
},
CollapseIcon = new DiagramCollapseIcon()
{
Shape = DiagramCollapseIcons.Plus,
}
};
nodes.Add(node);
}
}
Constructors
DiagramExpandIcon()
Initializes a new instance of the DiagramExpandIcon.
Declaration
public DiagramExpandIcon()
DiagramExpandIcon(DiagramExpandIcon)
Initializes a new instance of the DiagramExpandIcon which is the copy of a existing icon.
Declaration
public DiagramExpandIcon(DiagramExpandIcon src)
Parameters
Type | Name | Description |
---|---|---|
DiagramExpandIcon | src | The source DiagramExpandIcon used to create the copy. |
Properties
Shape
Gets or sets the shape of the Expand Icon.
Declaration
public DiagramExpandIcons Shape { get; set; }
Property Value
Type | Description |
---|---|
DiagramExpandIcons | A DiagramExpandIcons representing the shape of the Expand Icon. The default value is Minus. |
Remarks
The Diagram provides built-in DiagramExpandIcons, including Minus, ArrowUp, and Template, among others.
Custom shapes, such as Path Shape, can also be applied to the Expand Icon.
Examples
<SfDiagramComponent Height="600px" Nodes="@nodes" />
@code
{
//Initialize the node collection with nodes and Expand & CollapseIcons
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
protected override void OnInitialized()
{
Node node = new Node()
{
ExpandIcon = new DiagramExpandIcon()
{
Shape = DiagramExpandIcons.Minus,
},
CollapseIcon = new DiagramCollapseIcon()
{
Shape = DiagramExpandIcons.Path,
PathData = "M100,200 C100,100 250,100 250,200 S400,300 400,200",
}
};
nodes.Add(node);
}
}
Methods
Clone()
Creates a new ExpandIcon that is a copy of the current ExpandIcon.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | ExpandIconShapeModel |