Blazor

Upgrade Guide User Guide Demos Support Forums Download
  • 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.ID
    CommonElement.Pivot
    CommonElement.IsDirt
    CommonElement.Visible
    CommonElement.OffsetX
    CommonElement.OffsetY
    CommonElement.CornerRadius
    CommonElement.MinHeight
    CommonElement.MinWidth
    CommonElement.MaxWidth
    CommonElement.MaxHeight
    CommonElement.Width
    CommonElement.Height
    CommonElement.RotationAngle
    CommonElement.Margin
    CommonElement.HorizontalAlignment
    CommonElement.VerticalAlignment
    CommonElement.RelativeMode
    CommonElement.Style
    CommonElement.ParentID
    CommonElement.DesiredSize
    CommonElement.ActualSize
    CommonElement.Bounds
    CommonElement.Shadow
    CommonElement.OuterBounds
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class TextElement : DiagramElement
    Examples
    <SfDiagramComponent Width = "1000px" Height="1000px" @bind-Nodes="Nodes" SetNodeTemplate="SetTemplate">
    </SfDiagramComponent>    
    @code
    { 
        DiagramObjectCollection<Node> Nodes = new DiagramObjectCollection<Node>();
        private ICommonElement 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 Description
    System.String

    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 - 2022 Syncfusion Inc. All Rights Reserved