DiagramCanvasDrawable
Renders a diagram on a MAUI GraphicsView using Microsoft.Maui.Graphics.
Implements: IDrawable
Properties
public DiagramEditorState EditorState { get; set; }
value = diagramCanvasDrawable.EditorState
diagramCanvasDrawable.EditorState = value
Editor state for drawing link creation feedback.
public ICompositionModel Model { get; set; }
value = diagramCanvasDrawable.Model
diagramCanvasDrawable.Model = value
The diagram model to render.
public float PanX { get; set; }
value = diagramCanvasDrawable.PanX
diagramCanvasDrawable.PanX = value
Horizontal pan offset.
public float PanY { get; set; }
value = diagramCanvasDrawable.PanY
diagramCanvasDrawable.PanY = value
Vertical pan offset.
public RectF? RubberBandRect { get; set; }
value = diagramCanvasDrawable.RubberBandRect
diagramCanvasDrawable.RubberBandRect = value
Current rubber band selection rectangle (screen coordinates), or null when not selecting.
public DiagramElement SelectedElement { get; }
value = diagramCanvasDrawable.SelectedElement
Get the DiagramElement for the selected node.
public string SelectedNodeKey { get; set; }
value = diagramCanvasDrawable.SelectedNodeKey
diagramCanvasDrawable.SelectedNodeKey = value
Key of currently selected node, or null.
public float TouchHitPadding { get; set; }
value = diagramCanvasDrawable.TouchHitPadding
diagramCanvasDrawable.TouchHitPadding = value
Extra touch padding for node hit-testing on touch devices.
public float Zoom { get; set; }
value = diagramCanvasDrawable.Zoom
diagramCanvasDrawable.Zoom = value
Current zoom level (0.1 to 5.0).
Methods
public void ClearCompatibleSockets()
diagramCanvasDrawable.ClearCompatibleSockets()
Clear compatible sockets highlighting.
public PointF DiagramToScreen(float diagramX, float diagramY)
result = diagramCanvasDrawable.DiagramToScreen(diagramX, diagramY)
Transform a diagram point to screen coordinates.
private void DrawRubberBandSelection(ICanvas canvas, RectF screenRect)
diagramCanvasDrawable.DrawRubberBandSelection(canvas, screenRect)
Draws a rubber band selection rectangle in screen coordinates.
public RectF? GetContentBounds()
result = diagramCanvasDrawable.GetContentBounds()
Gets the bounding rectangle of all nodes in diagram coordinates.
public string HitTestNode(float screenX, float screenY)
result = diagramCanvasDrawable.HitTestNode(screenX, screenY)
Hit-test a screen point against nodes in the diagram.
public List<string> HitTestNodesInRect(RectF screenRect)
result = diagramCanvasDrawable.HitTestNodesInRect(screenRect)
Finds all node keys within a screen-space rectangle.
public SocketKey HitTestSocket(float screenX, float screenY)
result = diagramCanvasDrawable.HitTestSocket(screenX, screenY)
Hit-test a screen point against sockets in the diagram.
public PointF ScreenToDiagram(float screenX, float screenY)
result = diagramCanvasDrawable.ScreenToDiagram(screenX, screenY)
Transform a screen point to diagram coordinates.
public void SetCompatibleSockets(IEnumerable<SocketKey> sockets)
diagramCanvasDrawable.SetCompatibleSockets(sockets)
Set the compatible sockets for highlighting during link creation.