Blazor

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

    Show / Hide Table of Contents

    Class UserHandleEventsArgs

    Notifies when the mouse events such as mouse enter, mouse leave, mouse down, mouse up carried on the user handle.

    Inheritance
    System.Object
    UserHandleEventsArgs
    Namespace: Syncfusion.Blazor.Diagrams
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class UserHandleEventsArgs : Object
    Remarks
    Property Descriptions
    OnUserHandleMouseDown Triggers when the mouseDown on the user handle.
    OnUserHandleMouseUp Triggers when the mouseUp on the user handle.
    OnUserHandleMouseEnter Triggers when the mouseEnter on the user handle.
    OnUserHandleMouseLeave Triggers when the mouseLeave from the user handle.
    The following code shows how to define OnUserHandleMoudeDown property.
    Examples
    <SfDiagram Height="600px" Nodes="@NodeCollection" SelectedItems="@SelectedModel">
       <DiagramSnapSettings Constraints = "SnapConstraints.None" ></ DiagramSnapSettings >
       < DiagramEvents OnUserHandleMouseDown="MouseDown"></DiagramEvents>
    </SfDiagram>
    @code{
       // Defines diagram's nodes collection
       public ObservableCollection<DiagramNode> NodeCollection { get; set; }
       // Defines diagram's SelectedItems
       public Syncfusion.Blazor.Diagrams.DiagramSelectedItems SelectedModel { get; set; }
       ObservableCollection<DiagramUserHandle> UserHandles { get; set; }
       public void MouseDown(UserHandleEventsArgs args)
       {
           if ((args != null) && (args.Element != null))
           {
               Console.WriteLine("MouseDown");
           }
       }
       protected override void OnInitialized()
       {
           //Creating the user handle for cloning the objects
           DiagramUserHandle CloneHandle = new DiagramUserHandle()
           {
               //Name of the user handle
               Name = "clone",
               //Set pathdata for userhandle
               PathData = "M60.3,18H27.5c-3,0-5.5,2.4-5.5,5.5v38.2h5.5V23.5h32.7V18z M68.5,28.9h-30c-3,0-5.5,2.4-5.5,5.5v38.2c0,3,2.4,5.5,5.5,5.5h30c3,0,5.5-2.4,5.5-5.5V34.4C73.9,31.4,71.5,28.9,68.5,28.9z M68.5,72.5h-30V34.4h30V72.5z",
           };
           //Add user handle to the user handle collection
           UserHandles = new ObservableCollection<DiagramUserHandle>()
           {
               CloneHandle
           };
           SelectedModel = new Syncfusion.Blazor.Diagrams.DiagramSelectedItems()
           {
               //Enable user handle for selected items...
               Constraints = SelectorConstraints.UserHandle,
               UserHandles = this.UserHandles
           };
           NodeCollection = new ObservableCollection<DiagramNode>();
           DiagramNode DiagramNode = new DiagramNode()
           {
               Id = "node1",
               OffsetX = 100,
               OffsetY = 100,
               Width = 100,
               Height = 100,
               Style = new NodeShapeStyle() { Fill = "#659be5", StrokeColor = "none" },
           };
           NodeCollection.Add(DiagramNode);
       }
    }

    Constructors

    UserHandleEventsArgs()

    Declaration
    public UserHandleEventsArgs()

    Properties

    Element

    Returns the user handle object.

    Declaration
    public DiagramUserHandle Element { get; set; }
    Property Value
    Type Description
    DiagramUserHandle
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved