menu

Blazor

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

    Show / Hide Table of Contents

    Class TextElement

    Represents the text element which is used to display text or annotations.

    Inheritance
    System.Object
    CommonElement
    DiagramElement
    TextElement
    Inherited Members
    CommonElement.ActualSize
    CommonElement.Bounds
    CommonElement.CornerRadius
    CommonElement.DesiredSize
    CommonElement.Flip
    CommonElement.FlipMode
    CommonElement.Height
    CommonElement.HorizontalAlignment
    CommonElement.ID
    CommonElement.IsDirt
    CommonElement.Margin
    CommonElement.MaxHeight
    CommonElement.MaxWidth
    CommonElement.MinHeight
    CommonElement.MinWidth
    CommonElement.OffsetX
    CommonElement.OffsetY
    CommonElement.OuterBounds
    CommonElement.ParentID
    CommonElement.Pivot
    CommonElement.RelativeMode
    CommonElement.RotationAngle
    CommonElement.Shadow
    CommonElement.Style
    CommonElement.VerticalAlignment
    CommonElement.Visible
    CommonElement.Width
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class TextElement : DiagramElement
    Examples
    <SfDiagramComponent  SetNodeTemplate="SetTemplate">
    </SfDiagramComponent>    
    @code
    { 
        private CommonElement SetTemplate(IDiagramObject node)
        {
            if ((node as Node).ID == "node2")
            {
                DiagramCanvas container = new DiagramCanvas();
                TextElement textElement = new TextElement();
                textElement.Content = "node2content";
                container.Children.Add(textElement);
                return container;
            }
             return null;
        }
    }

    Constructors

    TextElement()

    Initializes a new instance of the TextElement.

    Declaration
    public TextElement()

    TextElement(TextElement)

    Creates a new instance of the TextElement from the given TextElement.

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

    TextElement.

    Properties

    Content

    Gets or sets the content of the text element that is to be displayed.

    Declaration
    public string Content { get; set; }
    Property Value
    Type
    System.String
    Examples
    <SfDiagramComponent SetNodeTemplate="SetTemplate">
    </SfDiagramComponent>    
    @code
    { 
        private CommonElement SetTemplate(IDiagramObject node)
        {
            if ((node as Node).ID == "node2")
            {
                DiagramCanvas container = new DiagramCanvas();
                TextElement textElement = new TextElement();
                textElement.Content = "node2content";
                return container;
            }
             return null;
        }
    }

    Methods

    Clone()

    Creates a new object that is a copy of the current text element.

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

    TextElement

    Overrides
    DiagramElement.Clone()
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved