menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DiagramMouseEventArgs - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class DiagramMouseEventArgs

    Provides information about current mouse events like mouse down, mouse move, etc.

    Inheritance
    System.Object
    DiagramMouseEventArgs
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class DiagramMouseEventArgs : Object
    Remarks

    It will return the event properties when a mouse down, mouse move, mouse leave, or mouse up event occurs based on the tool which is currently active, like resize, clone tool, etc.

    Examples
    public class CloneTool : DragController
    {
        public CloneTool(SfDiagramComponent diagram) : base(diagram)
        {
        }
        public override void OnMouseDown(DiagramMouseEventArgs args)
        {
            NodeBase newObject;
            if (Diagram.SelectionSettings.Nodes.Count > 0)
            {
                newObject = (Diagram.SelectionSettings.Nodes[0]).Clone() as Node;
            }
            else
            {
                newObject = (Diagram.SelectionSettings.Connectors[0]).Clone() as Connector;
            }
            newObject.ID += Diagram.Nodes.Count.ToString();
            Diagram.Copy();
            Diagram.Paste();
            ObservableCollection<IDiagramObject> obj = new ObservableCollection<IDiagramObject>() { Diagram.Nodes[Diagram.Nodes.Count - 1] as IDiagramObject };
            Diagram.Select(obj);
            args.Element = Diagram.SelectionSettings.Nodes[0] as IDiagramObject;
            base.OnMouseDown(args);
            this.InAction = true;
        }
    }

    Constructors

    DiagramMouseEventArgs()

    Declaration
    public DiagramMouseEventArgs()

    Properties

    ActualObject

    Gets the actual node or connector which is selected.

    Declaration
    public IDiagramObject ActualObject { get; set; }
    Property Value
    Type
    IDiagramObject

    ClickCount

    Gets the number of times it clicked.

    Declaration
    public int ClickCount { get; set; }
    Property Value
    Type
    System.Int32

    Element

    Gets or sets the selector object which is currently selected.

    Declaration
    public IDiagramObject Element { get; set; }
    Property Value
    Type
    IDiagramObject

    Position

    Gets the current position of the mouse pointer.

    Declaration
    public DiagramPoint Position { get; set; }
    Property Value
    Type
    DiagramPoint

    Target

    Gets or sets the object under the source objects.

    Declaration
    public IDiagramObject Target { get; set; }
    Property Value
    Type
    IDiagramObject
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved