Class ConnectionController
Represents a ConnectionController that manages the connection operations between connectors and nodes in diagram interactions.
Inheritance
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class ConnectionController : InteractionControllerBase
Remarks
The ConnectionController extends InteractionControllerBase to handle connector-to-node connections in diagram components.
This controller manages connection lifecycle operations and user interactions for establishing connections between diagram elements with boundary constraint validation.
Methods
OnMouseDown(DiagramMouseEventArgs)
Handles mouse down events when the mouse pointer is moved over the connector target point or source point and a mouse button is clicked.
Declaration
public override void OnMouseDown(DiagramMouseEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DiagramMouseEventArgs | args | A DiagramMouseEventArgs containing information about the mouse event, including position coordinates, button state, and target element. Can be null if no event data is available. |
Overrides
Remarks
Initializes connection operations by setting InAction property to true and creating an undo backup.
Override this method to implement custom connection validation or additional mouse down behavior.
OnMouseLeave(DiagramMouseEventArgs)
Handles the mouse up event when the mouse pointer leaves the connector source or target point.
Declaration
public override void OnMouseLeave(DiagramMouseEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DiagramMouseEventArgs | args | A DiagramMouseEventArgs containing information about the mouse event. |
Overrides
Remarks
Automatically invoked when the mouse exits connector endpoints. Internally calls MouseUp to handle the event.
Override to implement custom connection validation or mouse leave behavior.
OnMouseMove(DiagramMouseEventArgs)
Handles mouse move events when the mouse button is clicked on the connector end thumb and moved over the diagram.
Declaration
public override bool OnMouseMove(DiagramMouseEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DiagramMouseEventArgs | args | A DiagramMouseEventArgs instance containing information about the mouse events, including position coordinates, button state, and target element. Can be null if no event data is available. |
Returns
Type | Description |
---|---|
System.Boolean | A System.Boolean value indicating whether a connection was successfully established. Returns true if the connector was connected to a valid target; otherwise, false. |
Overrides
Remarks
Called during connector drag operations to detect valid connection targets.
Override this method to implement custom connection validation or additional mouse move behavior.
OnMouseUp(DiagramMouseEventArgs)
Handles the mouse up event when the mouse pointer is moved over the Connector and a mouse button is released.
Declaration
public override void OnMouseUp(DiagramMouseEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DiagramMouseEventArgs | args | A DiagramMouseEventArgs containing information about the mouse event, including position coordinates, button state, and target element. Can be null if no event data is available. |
Overrides
Remarks
Called during connector drag operations to handle connection target detection and visual feedback updates.
Override this method to implement custom connection validation or additional mouse up behavior.