Blazor

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

    Show / Hide Table of Contents

    Class DiagramTools

    DrawingTools allow users to draw objects (nodes, connectors, etc.,) during runtime by clicking and dragging.

    Inheritance
    System.Object
    DiagramTools
    Namespace: Syncfusion.Blazor.Diagrams
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public sealed class DiagramTools : Enum
    Remarks
    The below code snippet is an example to set DiagramTools to DrawOnce.
    Examples
    <input Type="button" value="addNode" @onclick="AddNode" />
    <SfDiagram @ref = "Diagram" Nodes="@NodeCollection" Width="100%" Height="540px">
        <DiagramSnapSettings Constraints = "SnapConstraints.None" />
    </ SfDiagram >
    @code
    {
       SfDiagram Diagram;
       public ObservableCollection<DiagramNode> NodeCollection = new ObservableCollection<DiagramNode>();
       protected override void OnInitialized()
       {
           DiagramNode Node = new DiagramNode()
           {
               OffsetX = 200,
               OffsetY = 200,
               Width = 100,
               Height = 100,
           };
           NodeCollection.Add(Node);
       }
       private void AddNode()
       {
           //To draw an object once, activate draw once
           Diagram.Tool = DiagramTools.DrawOnce;
           Diagram.DrawingObject = new DiagramNode()
           {
               Shape = new DiagramShape() { Type = Shapes.Basic, BasicShape = BasicShapes.Rectangle },
           };
       }
    }

    Fields

    ContinuousDraw

    It allows users to draw the nodes or connectors continuously. Once it is activated, users cannot perform any other interaction in the diagram.

    Declaration
    public const DiagramTools ContinuousDraw
    Field Value
    Type Description
    DiagramTools

    Default

    Sets the drawing tools to default.

    Declaration
    public const DiagramTools Default
    Field Value
    Type Description
    DiagramTools

    DrawOnce

    It allows users to draw a node or connector at once.

    Declaration
    public const DiagramTools DrawOnce
    Field Value
    Type Description
    DiagramTools

    MultipleSelect

    It allows users to select multiple nodes and connectors.

    Declaration
    public const DiagramTools MultipleSelect
    Field Value
    Type Description
    DiagramTools

    None

    Disables all the drawing tools.

    Declaration
    public const DiagramTools None
    Field Value
    Type Description
    DiagramTools

    SingleSelect

    It allows users to select only individual nodes or connectors.

    Declaration
    public const DiagramTools SingleSelect
    Field Value
    Type Description
    DiagramTools

    value__

    Declaration
    public int value__
    Field Value
    Type Description
    System.Int32

    ZoomPan

    It allows users to pan the diagram.

    Declaration
    public const DiagramTools ZoomPan
    Field Value
    Type Description
    DiagramTools
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved