Class TextElement
Represents the text element which is used to display text or annotations.
Inherited Members
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 |