menu

Blazor

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

    Show / Hide Table of Contents

    Class PolygonDrawingController

    Represents a controller that provides functionality for drawing polygon shape nodes dynamically using the polygon drawing tool in a diagram.

    Inheritance
    System.Object
    CommonController
    InteractionControllerBase
    PolygonDrawingController
    Inherited Members
    InteractionControllerBase.CurrentPosition
    InteractionControllerBase.InAction
    InteractionControllerBase.OnMouseLeave(DiagramMouseEventArgs)
    InteractionControllerBase.OnMouseUp(DiagramMouseEventArgs)
    InteractionControllerBase.PreviousPosition
    InteractionControllerBase.StartPosition
    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
    InteractionControllerBase.OnMouseDown(DiagramMouseEventArgs)
    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
    InteractionControllerBase.OnMouseMove(DiagramMouseEventArgs)
    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.

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