Class NodeDrawingController
Represents a controller class that provides functionality for drawing nodes in a diagram component.
Inherited Members
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
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
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
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.