menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class HorizontalAlignment - API Reference

    Show / Hide Table of Contents

    Class HorizontalAlignment

    Defines how the diagram elements must be aligned based on its immediate parent.

    Inheritance
    System.Object
    HorizontalAlignment
    Namespace: Syncfusion.Blazor.Diagrams
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public sealed class HorizontalAlignment : Enum
    Remarks
    To know more about using Horizontal Alignment, refer to these links:
    1. DiagramPort
    2. DiagramNode
    3. DiagramLayout
    4. DiagramUserHandle
    5. DiagramConnectorAnnotation
    6. DiagramNodeAnnotation
    7. NodeExpandIcon
    8. NodeCollapseIcon
    To apply port horizontal alignment, use the below code.
    Examples
    <SfDiagram Height="600px" Nodes="@NodeCollection">
    </SfDiagram>
    @code{
       public ObservableCollection<DiagramNode> NodeCollection = new ObservableCollection<DiagramNode>() { };
       protected override void OnInitialized()
       {
           // A node is created and stored in nodes array.
           DiagramNode Node = new DiagramNode()
           {
               // . .
               // Initialize port collection
               Ports = new ObservableCollection<DiagramPort>() {
               new DiagramPort() {
                   HorizontalAlignment = HorizontalAlignment.Left
               }},
           };
           NodeCollection.Add(Node);
        }
    }

    Fields

    Auto

    Aligns the diagram element based on its immediate parent’s horizontal alignment property.

    Declaration
    public const HorizontalAlignment Auto
    Field Value
    Type Description
    HorizontalAlignment

    Center

    Align the diagram element horizontally to the center of its immediate parent.

    Declaration
    public const HorizontalAlignment Center
    Field Value
    Type Description
    HorizontalAlignment

    Left

    Align the diagram element horizontally to its immediate parent's left side.

    Declaration
    public const HorizontalAlignment Left
    Field Value
    Type Description
    HorizontalAlignment

    Right

    Align the diagram element horizontally to its immediate parent's right side.

    Declaration
    public const HorizontalAlignment Right
    Field Value
    Type Description
    HorizontalAlignment

    Stretch

    Stretch the diagram element horizontally to its immediate parent’s.

    Declaration
    public const HorizontalAlignment Stretch
    Field Value
    Type Description
    HorizontalAlignment

    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