Blazor

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class NudgeDirection - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class NudgeDirection

    Specifies the direction in which the selected element must be moved during nudge operation.

    Inheritance
    System.Object
    NudgeDirection
    Namespace: Syncfusion.Blazor.Diagrams
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public sealed class NudgeDirection : Enum
    Remarks
    To know more about using nudging direction, refer to these links
    1. Commands
    2. DiagramMethods
    To apply nudging direction, use the below code.
    Examples
    DiagramMethods
    <input type = "button" value="Nudge Left" @onclick="@OnNudgeLeft">
    <input type = "button" value="Nudge Right" @onclick="@OnNudgeRight">
    <input type = "button" value="Nudge Top" @onclick="@OnNudgeTop" />
    <input type = "button" value="Nudge Bottom" @onclick="@OnNudgeBottom" />
    <SfDiagram @ref = "@Diagram" Height="600px" Nodes="@NodeCollection" Connectors="@ConnectorCollection">
    </SfDiagram>
    @code {
       /// reference of the diagram
       SfDiagram Diagram;
       /// To define node collection
       public ObservableCollection<DiagramNode> NodeCollection = new ObservableCollection<DiagramNode>();
       ///Defines diagram's connector collection
       public ObservableCollection<DiagramConnector> ConnectorCollection = new ObservableCollection<DiagramConnector>();
       protected override void OnInitialized()
       {
           /// A node is created and stored in nodes collection.
           DiagramNode Node1 = new DiagramNode()
           {
               Id = "Node1",
               /// Position of the node
               OffsetX = 250,
               OffsetY = 250,
               /// Size of the node
               Width = 100,
               Height = 100,
               Style = new NodeShapeStyle() { Fill = "#6BA5D7", StrokeColor = "white" }
           };
           /// Add node
           NodeCollection.Add(Node1);
           DiagramConnector Connector1 = new DiagramConnector()
           {
               Id = "Connector1",
               SourcePoint = new ConnectorSourcePoint() { X = 100, Y = 100 },
               TargetPoint = new ConnectorTargetPoint() { X = 200, Y = 200 },
               TargetDecorator = new ConnectorTargetDecorator()
               {
                   Shape = DecoratorShapes.Arrow,
                   Style = new DecoratorShapeStyle() { Fill = "#6f409f", StrokeColor = "#6f409f", StrokeWidth = 1 }
               },
               Style = new ConnectorShapeStyle() { StrokeColor = "#6f409f", StrokeWidth = 1 },
               Type = Segments.Orthogonal
           };
           ConnectorCollection.Add(Connector1);
       }
       public void OnNudgeLeft()
       {
           /// Selected objects move one step to left
           Diagram.Nudge(NudgeDirection.Left);
       }
       public void OnNudgeRight()
       {
           /// Selected objects move one step to right
           Diagram.Nudge(NudgeDirection.Right);
       }
       public void OnNudgeTop()
       {
           /// Selected objects move one step to top
           Diagram.Nudge(NudgeDirection.Up);
       }
       public void OnNudgeBottom()
       {
           /// Selected objects move one step to bottom
           Diagram.Nudge(NudgeDirection.Down);
       }
    }

    Fields

    Down

    Nudge the object in the down direction.

    Declaration
    public const NudgeDirection Down
    Field Value
    Type Description
    NudgeDirection

    Left

    Nudge the object in the left direction.

    Declaration
    public const NudgeDirection Left
    Field Value
    Type Description
    NudgeDirection

    Right

    Nudge the object in the right direction.

    Declaration
    public const NudgeDirection Right
    Field Value
    Type Description
    NudgeDirection

    Up

    Nudge the object in the up direction.

    Declaration
    public const NudgeDirection Up
    Field Value
    Type Description
    NudgeDirection

    value__

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