menu

Blazor

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

    Show / Hide Table of Contents

    Class NodeDrawingController

    Represents a controller class that provides functionality for drawing nodes in a diagram component.

    Inheritance
    System.Object
    CommonController
    InteractionControllerBase
    NodeDrawingController
    Inherited Members
    InteractionControllerBase.CurrentPosition
    InteractionControllerBase.InAction
    InteractionControllerBase.OnMouseLeave(DiagramMouseEventArgs)
    InteractionControllerBase.PreviousPosition
    InteractionControllerBase.StartPosition
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class NodeDrawingController : InteractionControllerBase
    Remarks

    The NodeDrawingController extends InteractionControllerBase to handle interactive node creation through user input such as mouse events and drag operations.

    This controller manages the complete node drawing lifecycle from initiation to completion, ensuring proper integration with the diagram's existing node collection.

    Constructors

    NodeDrawingController(SfDiagramComponent)

    Initializes a new instance of the NodeDrawingController class with the specified SfDiagramComponent.

    Declaration
    public NodeDrawingController(SfDiagramComponent diagram)
    Parameters
    Type Name Description
    SfDiagramComponent diagram

    A SfDiagramComponent instance that represents the diagram component where node drawing operations will be performed. This parameter cannot be null.

    Remarks

    The NodeDrawingController extends InteractionControllerBase to handle interactive node creation within a diagram through user interactions like clicking and dragging.

    This controller manages the complete lifecycle of node drawing operations, ensuring proper integration with the diagram's existing node collection.

    Methods

    OnMouseDown(DiagramMouseEventArgs)

    This method triggers when the mouse pointer is moved over the diagram and a mouse button is pressed.

    Declaration
    public override void OnMouseDown(DiagramMouseEventArgs args)
    Parameters
    Type Name Description
    DiagramMouseEventArgs args

    DiagramMouseEventArgs

    Overrides
    InteractionControllerBase.OnMouseDown(DiagramMouseEventArgs)

    OnMouseMove(DiagramMouseEventArgs)

    Handles mouse move events when the mouse button is pressed and the pointer is moved over the SfDiagramComponent.

    Declaration
    public override bool OnMouseMove(DiagramMouseEventArgs args)
    Parameters
    Type Name Description
    DiagramMouseEventArgs args

    A DiagramMouseEventArgs instance containing information about the mouse event, including position coordinates, button state, and target elements. This parameter cannot be null.

    Returns
    Type Description
    System.Boolean

    A System.Boolean value indicating whether the mouse move event should be blocked from further processing. Returns true to prevent default behavior, or false to allow normal event propagation.

    Overrides
    InteractionControllerBase.OnMouseMove(DiagramMouseEventArgs)
    Remarks

    Called during node drawing operations to enable custom mouse movement handling and visual feedback.

    OnMouseUp(DiagramMouseEventArgs)

    Handles the mouse up event when the mouse pointer is moved over the node and a mouse button is released during node drawing operations.

    Declaration
    public override void OnMouseUp(DiagramMouseEventArgs args)
    Parameters
    Type Name Description
    DiagramMouseEventArgs args

    A DiagramMouseEventArgs containing mouse event information. Can be null.

    Overrides
    InteractionControllerBase.OnMouseUp(DiagramMouseEventArgs)
    Remarks

    Called when completing drag operations or finalizing node placement. Override to implement custom node drawing completion behavior or cleanup operations.

    The method safely handles null arguments and calls the base implementation to maintain proper event handling.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved