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
shapeShapeElementThe shape element to render.
contextShapeRenderContextThe 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
visualControlThe shape's visual control.
shapeShapeElementThe shape element.
contextShapeRenderContextThe 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
visualControlThe shape's visual control.
shapeShapeElementThe shape element with updated data.
contextShapeRenderContextThe rendering context.