alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class DiagramMouseEventArgs

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

    Inheritance
    object
    DiagramMouseEventArgs
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class DiagramMouseEventArgs
    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
    int

    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
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved