Class DiagramCollapseIcon
Represents a collapse icon for a node within a diagram.
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class DiagramCollapseIcon : DiagramIcon, IDiagramObject, ICloneable
Remarks
The DiagramCollapseIcon class is used to define the appearance and behavior of the collapse icon associated with a node.
Examples
Demonstrates how to initialize nodes with expand and collapse icons in a diagram:
<SfDiagramComponent Height="600px" Nodes="@nodes" />
@code
{
// Initialize the node collection with nodes that have Expand & CollapseIcon
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
protected override void OnInitialized()
{
Node node = new Node()
{
ExpandIcon = new DiagramExpandIcon()
{
Shape = DiagramExpandIcons.Minus,
},
CollapseIcon = new DiagramCollapseIcon()
{
Shape = DiagramCollapseIcons.Plus,
}
};
nodes.Add(node);
}
}
Constructors
DiagramCollapseIcon()
Initializes a new instance of the DiagramCollapseIcon.
Declaration
public DiagramCollapseIcon()
DiagramCollapseIcon(DiagramCollapseIcon)
Initializes a new instance of the DiagramCollapseIcon class which copies the properties from an existing DiagramCollapseIcon.
Declaration
public DiagramCollapseIcon(DiagramCollapseIcon src)
Parameters
Type | Name | Description |
---|---|---|
DiagramCollapseIcon | src | An existing instance of DiagramCollapseIcon from which to copy property values. |
Properties
Shape
Gets or sets the icon representing the collapsed state of a diagram node, allowing toggle functionality between expanded and collapsed states.
Declaration
public DiagramCollapseIcons Shape { get; set; }
Property Value
Type |
---|
DiagramCollapseIcons |
Remarks
The diagram provides several built-in collapse icons through the DiagramCollapseIcons class, including options like Plus, ArrowDown, and Template.
Examples
Demonstrates how to create a diagram node with custom expand and collapse icons.
<SfDiagramComponent Height="600px" Nodes="@nodes" />
@code
{
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
protected override void OnInitialized()
{
Node node = new Node()
{
ExpandIcon = new DiagramExpandIcon()
{
Shape = DiagramExpandIcons.Minus,
},
CollapseIcon = new DiagramCollapseIcon()
{
Shape = DiagramCollapseIcons.Plus,
}
};
nodes.Add(node);
}
}
Methods
Clone()
Creates a new DiagramCollapseIcon that is a copy of the current collapse icon.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | A DiagramCollapseIcon object that is a duplicate of the current instance. |