Class PolygonDrawingController
Represents a controller that provides functionality for drawing polygon shape nodes dynamically using the polygon drawing tool in a diagram.
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class PolygonDrawingController : InteractionControllerBase
Remarks
The PolygonDrawingController extends InteractionControllerBase to handle user interactions for creating polygon nodes.
Constructors
PolygonDrawingController(SfDiagramComponent)
Initializes a new instance of the PolygonDrawingController class with the specified diagram component.
Declaration
public PolygonDrawingController(SfDiagramComponent diagram)
Parameters
Type | Name | Description |
---|---|---|
SfDiagramComponent | diagram | The SfDiagramComponent instance that this controller will manage for polygon drawing operations. This parameter cannot be null and provides the diagram context for interactive polygon creation. |
Remarks
The PolygonDrawingController extends InteractionControllerBase to handle user interactions for creating polygon nodes through mouse or touch input.
Methods
OnMouseDown(DiagramMouseEventArgs)
Handles the mouse down event when a drawing tool is active and polygon shapes are being created in the SfDiagramComponent.
Declaration
public override void OnMouseDown(DiagramMouseEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DiagramMouseEventArgs | args | A DiagramMouseEventArgs containing information about the mouse event, including cursor position, button pressed, and modifier keys. This parameter provides the context needed to initiate or continue polygon drawing operations. |
Overrides
Remarks
Automatically invoked when the user clicks while the polygon drawing tool is active. Handles completing polygon drawing operations.
OnMouseMove(DiagramMouseEventArgs)
Handles mouse move events during polygon drawing operations in the SfDiagramComponent.
Declaration
public override bool OnMouseMove(DiagramMouseEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
DiagramMouseEventArgs | args | A DiagramMouseEventArgs containing mouse event data for polygon vertex positioning. |
Returns
Type | Description |
---|---|
System.Boolean | A System.Boolean indicating whether the event was handled. Returns true when consumed by polygon drawing logic, false otherwise. |
Overrides
Remarks
Invoked automatically during polygon drawing to provide real-time visual feedback by updating the preview line from the last vertex to current mouse position.
Works with mouse down/up events to complete the polygon drawing workflow.