Class SelectionController
Represents a controller that provides object selection functionality within the SfDiagramComponent.
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class SelectionController : InteractionControllerBase
Remarks
The SelectionController manages the selection state of diagram objects and handles user interactions for selecting single or multiple objects through mouse clicks, keyboard shortcuts, and programmatic selection.
Constructors
SelectionController(SfDiagramComponent)
Initializes a new instance of the SelectionController class with the specified diagram component.
Declaration
public SelectionController(SfDiagramComponent diagram)
Parameters
Type | Name | Description |
---|---|---|
SfDiagramComponent | diagram | The SfDiagramComponent instance that this controller will manage selection operations for. |
Remarks
The SelectionController manages selection state of diagram objects and handles user interactions for selecting nodes, connectors, and other visual elements.
Methods
OnMouseDown(DiagramMouseEventArgs)
Handles the mouse down event when the user clicks on a diagram element to initiate selection operations.
Declaration
public override void OnMouseDown(DiagramMouseEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DiagramMouseEventArgs | args | A DiagramMouseEventArgs containing mouse event information including position and target element. |
Overrides
Remarks
Sets the InAction property to true and delegates to the base class for additional processing.
OnMouseLeave(DiagramMouseEventArgs)
Handles the mouse leave event when the mouse pointer exits a selected diagram element in the SelectionController.
Declaration
public override void OnMouseLeave(DiagramMouseEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DiagramMouseEventArgs | args | A DiagramMouseEventArgs containing mouse event information including position and target element. |
Overrides
Remarks
Automatically triggered when the mouse leaves a selected diagram element.
If InAction property is true, delegates to OnMouseUp(DiagramMouseEventArgs) to complete the ongoing selection operation.
OnMouseMove(DiagramMouseEventArgs)
Handles mouse move events during selection operations when the user clicks and drags selected elements in the diagram.
Declaration
public override bool OnMouseMove(DiagramMouseEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DiagramMouseEventArgs | args | A DiagramMouseEventArgs containing mouse event information including position, target element, and button state. |
Returns
Type | Description |
---|---|
System.Boolean | A System.Boolean indicating whether the event was handled. Returns true when processing drag operations, false otherwise. |
Overrides
Remarks
Invoked during selection operations when dragging elements. Handles position updates and visual feedback during drag operations.
OnMouseUp(DiagramMouseEventArgs)
Handles mouse up events when the user releases the mouse button after clicking on selected elements in the SfDiagramComponent.
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 the mouse button is released on selected diagram elements to complete selection or drag operations.