menu

Blazor

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

    Show / Hide Table of Contents

    Class AlignmentMode

    It allows the user to the alignment of the selected objects based on the first object in the selector or entire selector bounds.

    Inheritance
    System.Object
    AlignmentMode
    Namespace: Syncfusion.Blazor.Diagrams
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public sealed class AlignmentMode : Enum
    Examples
    <input type="button" value="Alignment" @onclick="@OnAlign" />
    <SfDiagram @ref = "@Diagram" Height="600px" Nodes="@NodeCollection">
    </SfDiagram>
    @code{
       SfDiagram Diagram;
       public ObservableCollection<DiagramNode> NodeCollection;
       protected override void OnInitialized()
       {
           NodeCollection = new ObservableCollection<DiagramNode>(){
               new DiagramNode()
               {
                   OffsetX = 50, OffsetY = 100,Width = 70, Height = 40,
               },
               new DiagramNode()
               {
                   OffsetX = 292, OffsetY = 293,Width = 60, Height = 80,
               },
           };
       }
       public async void OnAlign()
       {
           Diagram.SelectAll();
           //Aligns the selected items to top
           Diagram.Align(AlignmentOptions.Top, null, AlignmentMode.Selector);
       }
    }

    Fields

    Object

    Aligns the objects based on the first object in the selected list

    Declaration
    public const AlignmentMode Object
    Field Value
    Type Description
    AlignmentMode

    Selector

    Aligns the objects based on the selector bounds

    Declaration
    public const AlignmentMode Selector
    Field Value
    Type Description
    AlignmentMode

    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