Table of Contents

Class ShapeRenderContext

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

Context object passed to shape renderers with information needed for rendering.

public class ShapeRenderContext
Inheritance
ShapeRenderContext
Inherited Members

Constructors

ShapeRenderContext(FlowCanvasSettings, double)

Creates a new shape render context.

public ShapeRenderContext(FlowCanvasSettings settings, double scale)

Parameters

settings FlowCanvasSettings

Canvas settings for sizing and styling.

scale double

Current zoom scale.

Properties

Scale

Gets the current zoom scale factor.

public double Scale { get; }

Property Value

double

Settings

Gets the canvas settings.

public FlowCanvasSettings Settings { get; }

Property Value

FlowCanvasSettings

Methods

CreateBrush(string?)

Creates a brush from a color string. Returns null for null/empty strings.

public static IBrush? CreateBrush(string? colorString)

Parameters

colorString string

The color string to convert.

Returns

IBrush

A SolidColorBrush or null.

ParseColor(string?)

Parses a color string to an Avalonia Color. Supports hex (#RRGGBB, #AARRGGBB), named colors, or returns transparent for null/invalid.

public static Color ParseColor(string? colorString)

Parameters

colorString string

The color string to parse.

Returns

Color

The parsed color or Transparent if parsing fails.

ParseDashStyle(string?)

Parses a dash array string into a DashStyle.

public static DashStyle? ParseDashStyle(string? dashArray)

Parameters

dashArray string

Comma-separated dash pattern, e.g., "5,3" or "10,5,2,5".

Returns

DashStyle

A DashStyle or null for solid lines.