DiagramCanvasDrawable

StockSharp.Xaml.Diagram.Maui

Renders a diagram on a MAUI GraphicsView using Microsoft.Maui.Graphics.

Implements: IDrawable

Properties

EditorState
public DiagramEditorState EditorState { get; set; }
value = diagramCanvasDrawable.EditorState
diagramCanvasDrawable.EditorState = value

Editor state for drawing link creation feedback.

Model
public ICompositionModel Model { get; set; }
value = diagramCanvasDrawable.Model
diagramCanvasDrawable.Model = value

The diagram model to render.

PanX
public float PanX { get; set; }
value = diagramCanvasDrawable.PanX
diagramCanvasDrawable.PanX = value

Horizontal pan offset.

PanY
public float PanY { get; set; }
value = diagramCanvasDrawable.PanY
diagramCanvasDrawable.PanY = value

Vertical pan offset.

RubberBandRect
public RectF? RubberBandRect { get; set; }
value = diagramCanvasDrawable.RubberBandRect
diagramCanvasDrawable.RubberBandRect = value

Current rubber band selection rectangle (screen coordinates), or null when not selecting.

SelectedElement
public DiagramElement SelectedElement { get; }
value = diagramCanvasDrawable.SelectedElement

Get the DiagramElement for the selected node.

SelectedNodeKey
public string SelectedNodeKey { get; set; }
value = diagramCanvasDrawable.SelectedNodeKey
diagramCanvasDrawable.SelectedNodeKey = value

Key of currently selected node, or null.

TouchHitPadding
public float TouchHitPadding { get; set; }
value = diagramCanvasDrawable.TouchHitPadding
diagramCanvasDrawable.TouchHitPadding = value

Extra touch padding for node hit-testing on touch devices.

Zoom
public float Zoom { get; set; }
value = diagramCanvasDrawable.Zoom
diagramCanvasDrawable.Zoom = value

Current zoom level (0.1 to 5.0).

Methods

ClearCompatibleSockets
public void ClearCompatibleSockets()
diagramCanvasDrawable.ClearCompatibleSockets()

Clear compatible sockets highlighting.

DiagramToScreen
public PointF DiagramToScreen(float diagramX, float diagramY)
result = diagramCanvasDrawable.DiagramToScreen(diagramX, diagramY)

Transform a diagram point to screen coordinates.

DrawRubberBandSelection
private void DrawRubberBandSelection(ICanvas canvas, RectF screenRect)
diagramCanvasDrawable.DrawRubberBandSelection(canvas, screenRect)

Draws a rubber band selection rectangle in screen coordinates.

GetContentBounds
public RectF? GetContentBounds()
result = diagramCanvasDrawable.GetContentBounds()

Gets the bounding rectangle of all nodes in diagram coordinates.

HitTestNode
public string HitTestNode(float screenX, float screenY)
result = diagramCanvasDrawable.HitTestNode(screenX, screenY)

Hit-test a screen point against nodes in the diagram.

HitTestNodesInRect
public List<string> HitTestNodesInRect(RectF screenRect)
result = diagramCanvasDrawable.HitTestNodesInRect(screenRect)

Finds all node keys within a screen-space rectangle.

HitTestSocket
public SocketKey HitTestSocket(float screenX, float screenY)
result = diagramCanvasDrawable.HitTestSocket(screenX, screenY)

Hit-test a screen point against sockets in the diagram.

ScreenToDiagram
public PointF ScreenToDiagram(float screenX, float screenY)
result = diagramCanvasDrawable.ScreenToDiagram(screenX, screenY)

Transform a screen point to diagram coordinates.

SetCompatibleSockets
public void SetCompatibleSockets(IEnumerable<SocketKey> sockets)
diagramCanvasDrawable.SetCompatibleSockets(sockets)

Set the compatible sockets for highlighting during link creation.