menu

Blazor

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

    Show / Hide Table of Contents

    Class TextShape

    Represents the TextShape class which allows the user to draw nodes in the diagram with a shape based on text as per user preference.

    Inheritance
    System.Object
    DiagramObject
    Shape
    TextShape
    Implements
    IDiagramObject
    System.ICloneable
    Inherited Members
    DiagramObject.GetParent()
    DiagramObject.OnPropertyChanged(String, Object, Object, IDiagramObject)
    Shape.Type
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class TextShape : Shape, IDiagramObject, ICloneable
    Remarks

    This class is beneficial for scenarios where a textual representation within the node is required.

    The TextShape class inherits from the Shape base class.

    Examples
    Node builtInNode = new Node()
    {
        // Position of the node
        OffsetX = 250,
        OffsetY = 250,
        // Size of the node
        Width = 100,
        Height = 100,
        Shape = new TextShape()
        {
            Content="Text Content"
        }
    };

    Constructors

    TextShape()

    Initializes a new instance of the TextShape class.

    Declaration
    public TextShape()

    TextShape(TextShape)

    Initializes a new instance of the TextShape class from an existing instance.

    Declaration
    public TextShape(TextShape src)
    Parameters
    Type Name Description
    TextShape src

    An instance of TextShape to copy.

    Properties

    Content

    Gets or sets the content to be displayed as a Text Node.

    Declaration
    public string Content { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the content displayed in the node. Default is null.

    Remarks

    This property is used to define the text that should be displayed within the node.

    Examples
    Node builtInNode = new Node()
    {
        // Position of the node
        OffsetX = 250,
        OffsetY = 250,
        // Size of the node
        Width = 100,
        Height = 100,
        Shape = new TextShape()
        {
            Content="Text Content"
        }
    };

    Methods

    Clone()

    Creates a new shape that is a copy of the current Text shape.

    Declaration
    public override object Clone()
    Returns
    Type
    System.Object
    Overrides
    Shape.Clone()

    Implements

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