menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DiagramCollapseIcon - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class DiagramCollapseIcon

    Represents a collapse icon for a node within a diagram.

    Inheritance
    System.Object
    DiagramObject
    DiagramIcon
    DiagramCollapseIcon
    Implements
    IDiagramObject
    System.ICloneable
    Inherited Members
    DiagramIcon.BorderColor
    DiagramIcon.BorderWidth
    DiagramIcon.CornerRadius
    DiagramIcon.Fill
    DiagramIcon.Height
    DiagramIcon.HorizontalAlignment
    DiagramIcon.Margin
    DiagramIcon.OffsetX
    DiagramIcon.OffsetY
    DiagramIcon.Padding
    DiagramIcon.PathData
    DiagramIcon.VerticalAlignment
    DiagramIcon.Width
    DiagramObject.GetParent()
    DiagramObject.OnPropertyChanged(String, Object, Object, IDiagramObject)
    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.

    Overrides
    DiagramObject.Clone()

    Implements

    IDiagramObject
    System.ICloneable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved