Table of Contents

Interface IShapeRenderer

Namespace
FlowGraph.Avalonia.Rendering.ShapeRenderers
Assembly
FlowGraph.Avalonia.dll

Interface for custom shape renderers. Implement this interface to create visual representations for shape element types.

public interface IShapeRenderer

Remarks

Shape renderers follow the same pattern as node and edge renderers, allowing consistent extensibility for all canvas elements.

Register implementations with ShapeRendererRegistry to handle specific shape types (rectangle, line, text, ellipse, etc.).

Methods

CreateShapeVisual(ShapeElement, ShapeRenderContext)

Creates the visual representation for a shape element.

Control CreateShapeVisual(ShapeElement shape, ShapeRenderContext context)

Parameters

shape ShapeElement

The shape element to render.

context ShapeRenderContext

The rendering context with theme, scale, and settings.

Returns

Control

A Control representing the shape visual.

UpdateSelection(Control, ShapeElement, ShapeRenderContext)

Updates the visual state when selection changes.

void UpdateSelection(Control visual, ShapeElement shape, ShapeRenderContext context)

Parameters

visual Control

The shape's visual control.

shape ShapeElement

The shape element.

context ShapeRenderContext

The rendering context.

UpdateVisual(Control, ShapeElement, ShapeRenderContext)

Updates an existing visual when the shape's properties change.

void UpdateVisual(Control visual, ShapeElement shape, ShapeRenderContext context)

Parameters

visual Control

The shape's visual control.

shape ShapeElement

The shape element with updated data.

context ShapeRenderContext

The rendering context.