Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class TextAlign

    Show / Hide Table of Contents

    Class TextAlign

    The TextAlign property allows the user to define the alignment of the text inside the text block.

    Inheritance
    System.Object
    TextAlign
    Namespace: Syncfusion.Blazor.Diagrams
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public sealed class TextAlign : Enum
    Remarks
    The below code snippet is an example to set the TextAlign to Justify.
    Examples
    <SfDiagram Height="600px" Nodes="@NodeCollection">
    </SfDiagram>
    @code
    {
       ///Defines diagram's node collection
       public ObservableCollection<DiagramNode> NodeCollection { get; set; }
       protected override void OnInitialized()
       {
           NodeCollection = new ObservableCollection<DiagramNode>();
           DiagramNode Node = new DiagramNode()
           {
               Width = 100, = 100,
               OffsetX = 100,
               OffsetY = 100,
               // Sets the textAlign as left for the content
               Annotations = new ObservableCollection<DiagramNodeAnnotation>() {
                   new DiagramNodeAnnotation() { Content = "Text align is set as Justify",Style = new AnnotationStyle(){ TextAlign = TextAlign.Justify} }
               },
           };
           NodeCollection.Add(Node);
       }
    }

    Fields

    Center

    Sets the alignment of text in the text block to the center.

    Declaration
    public const TextAlign Center
    Field Value
    Type Description
    TextAlign

    Justify

    Sets the alignment of text in respective to left and right margins.

    Declaration
    public const TextAlign Justify
    Field Value
    Type Description
    TextAlign

    Left

    Sets the alignment of text in the text block to the left.

    Declaration
    public const TextAlign Left
    Field Value
    Type Description
    TextAlign

    Right

    Sets the alignment of text in the text block to the right.

    Declaration
    public const TextAlign Right
    Field Value
    Type Description
    TextAlign

    value__

    Declaration
    public int value__
    Field Value
    Type Description
    System.Int32
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved