Table of Contents

Class FlowCanvasSettings

Namespace
FlowGraph.Avalonia
Assembly
FlowGraph.Avalonia.dll

Configuration settings for the FlowCanvas control.

public class FlowCanvasSettings
Inheritance
FlowCanvasSettings
Inherited Members

Properties

AutoPanEdgeDistance

Gets or sets the distance from viewport edge (in pixels) at which auto-pan activates. Default is 50 pixels.

public double AutoPanEdgeDistance { get; set; }

Property Value

double

AutoPanSpeed

Gets or sets the speed of auto-pan in pixels per frame. Higher values result in faster panning. Default is 10.

public double AutoPanSpeed { get; set; }

Property Value

double

AutoRouteEdges

Whether automatic edge routing is enabled. When enabled, edges will be routed around obstacles automatically.

public bool AutoRouteEdges { get; set; }

Property Value

bool

ConnectionSnapDistance

Distance in screen pixels within which a connection will snap to the nearest compatible port. Set to 0 to disable snap-to-port behavior.

public double ConnectionSnapDistance { get; set; }

Property Value

double

DebugCoordinateTransforms

Whether to output debug information for coordinate transformations.

public bool DebugCoordinateTransforms { get; set; }

Property Value

bool

Default

Default settings instance.

public static FlowCanvasSettings Default { get; }

Property Value

FlowCanvasSettings

DefaultEdgeType

The default edge type to use for newly created edges.

public EdgeType DefaultEdgeType { get; set; }

Property Value

EdgeType

DefaultRouterAlgorithm

The default router algorithm to use for routing.

public RouterAlgorithm DefaultRouterAlgorithm { get; set; }

Property Value

RouterAlgorithm

DiagnosticsCategories

Gets or sets the categories to include in diagnostics. Use bitwise OR to combine categories.

public LogCategory DiagnosticsCategories { get; set; }

Property Value

LogCategory

DiagnosticsLogFilePath

Gets or sets the path for file-based diagnostic logging. When set, diagnostic messages are also written to this file.

public string? DiagnosticsLogFilePath { get; set; }

Property Value

string

DiagnosticsMinimumLevel

Gets or sets the minimum log level for diagnostics. Messages below this level are ignored.

public LogLevel DiagnosticsMinimumLevel { get; set; }

Property Value

LogLevel

DirectRenderingNodeThreshold

Gets or sets the node count threshold for automatically enabling direct rendering. When the graph has more nodes than this threshold, DirectCanvasRenderer is automatically used. Set to 0 to disable auto-switching. Default is 100.

public int DirectRenderingNodeThreshold { get; set; }

Property Value

int

Remarks

Direct rendering bypasses the Avalonia visual tree and draws directly to a DrawingContext, providing significantly better performance for large graphs (500+ nodes).

EdgeEndpointHandleSize

Size of edge endpoint handles in pixels.

public double EdgeEndpointHandleSize { get; set; }

Property Value

double

EdgeHitAreaWidth

Width of the invisible hit area for edge click detection (in pixels). Higher values make edges easier to click but may overlap with other elements.

public double EdgeHitAreaWidth { get; set; }

Property Value

double

EdgeSelectedStrokeThickness

Stroke thickness for selected edges.

public double EdgeSelectedStrokeThickness { get; set; }

Property Value

double

EdgeStrokeThickness

Stroke thickness for normal (unselected) edges.

public double EdgeStrokeThickness { get; set; }

Property Value

double

EffectiveSnapGridSize

Gets the effective snap grid size.

public double EffectiveSnapGridSize { get; }

Property Value

double

EnableAutoPan

Gets or sets whether auto-pan is enabled when dragging near viewport edges. When true, the viewport automatically pans when dragging nodes or edges near the edge of the visible area. Default is true.

public bool EnableAutoPan { get; set; }

Property Value

bool

EnableDiagnostics

Gets or sets whether diagnostic logging is enabled. When enabled, FlowGraph will emit detailed diagnostic information.

public bool EnableDiagnostics { get; set; }

Property Value

bool

EnableEdgeLabelEditing

Whether double-clicking an edge triggers a label edit request. When enabled, double-clicking raises the EdgeLabelEditRequested event.

public bool EnableEdgeLabelEditing { get; set; }

Property Value

bool

EnableGroupLabelEditing

Whether double-clicking a group triggers a label edit request. When false, double-click toggles collapse (default behavior). When true, double-click raises NodeLabelEditRequested for the group.

public bool EnableGroupLabelEditing { get; set; }

Property Value

bool

EnableLod

Gets or sets whether LOD (Level of Detail) rendering is enabled. When true, visual details are automatically hidden at low zoom levels for better performance. When false, all details are always rendered regardless of zoom level. Default is true.

public bool EnableLod { get; set; }

Property Value

bool

EnableNodeLabelEditing

Whether double-clicking a node triggers a label edit request. When enabled, double-clicking raises the NodeLabelEditRequested event.

public bool EnableNodeLabelEditing { get; set; }

Property Value

bool

EnableShapeTextEditing

Whether double-clicking a shape (e.g., sticky note) triggers a text edit request. When enabled, double-clicking raises the ShapeTextEditRequested event.

public bool EnableShapeTextEditing { get; set; }

Property Value

bool

EnableVirtualization

Gets or sets whether virtualization is enabled. When enabled, only nodes and edges visible in the viewport are rendered. This significantly improves performance for large graphs (500+ nodes). Default is true.

public bool EnableVirtualization { get; set; }

Property Value

bool

FitToViewMinPaddingPercent

Minimum padding as a percentage of viewport size (0.0 to 1.0) when using FitToView. The effective padding is the larger of FitToViewPadding or this percentage. For example, 0.15 means at least 15% of the viewport dimension will be padding. Set to 0 to use only fixed pixel padding.

public double FitToViewMinPaddingPercent { get; set; }

Property Value

double

FitToViewPadding

Minimum padding (in pixels) around content when using FitToView. The actual padding may be larger based on FitToViewMinPaddingPercent.

public double FitToViewPadding { get; set; }

Property Value

double

GridDotSize

Size of grid dots in pixels.

public double GridDotSize { get; set; }

Property Value

double

GridSpacing

Spacing between grid dots in pixels.

public double GridSpacing { get; set; }

Property Value

double

GroupBackgroundOpacity

Opacity of the group background (0.0 to 1.0). Lower values create more translucent groups.

public double GroupBackgroundOpacity { get; set; }

Property Value

double

GroupBorderRadius

Border radius for group corners.

public double GroupBorderRadius { get; set; }

Property Value

double

GroupDefaultZIndex

Default ZIndex for group nodes. Groups typically render behind their children, so this defaults to ZIndexGroups (150).

public int GroupDefaultZIndex { get; set; }

Property Value

int

GroupHeaderHeight

Height of the group header area.

public double GroupHeaderHeight { get; set; }

Property Value

double

GroupMovementMode

Default movement mode for groups when dragged. MoveWithChildren moves all children with the group (default). MoveGroupOnly moves only the group boundary.

public GroupMovementMode GroupMovementMode { get; set; }

Property Value

GroupMovementMode

GroupMovementModeToggleKey

Modifier key that toggles the group movement mode while held. When pressed, temporarily switches between MoveWithChildren and MoveGroupOnly. Default is Shift (matching Nodify behavior).

public KeyModifiers GroupMovementModeToggleKey { get; set; }

Property Value

KeyModifiers

GroupPadding

Padding around children when auto-sizing groups.

public double GroupPadding { get; set; }

Property Value

double

GroupUseDashedBorder

Whether to use dashed borders for groups (React Flow style).

public bool GroupUseDashedBorder { get; set; }

Property Value

bool

IsReadOnly

Gets or sets whether the canvas is in read-only mode. When true, all editing interactions are disabled (no dragging, connecting, selecting, etc.). Pan and zoom still work. Useful for displaying graphs without allowing modification. Default is false.

public bool IsReadOnly { get; set; }

Property Value

bool

LodLabelsZoomThreshold

Gets or sets the zoom threshold below which node labels are hidden. When zoom level is below this value, labels are not rendered for better performance. Default is 0.3 (30% zoom).

public double LodLabelsZoomThreshold { get; set; }

Property Value

double

LodPortsZoomThreshold

Gets or sets the zoom threshold below which ports are hidden. When zoom level is below this value, ports are not rendered for better performance. Default is 0.4 (40% zoom).

public double LodPortsZoomThreshold { get; set; }

Property Value

double

LodSimplifiedZoomThreshold

Gets or sets the zoom threshold below which simplified node rendering is used. When zoom level is below this value, nodes are rendered as simple rectangles without rounded corners or custom renderers. Default is 0.5 (50% zoom).

public double LodSimplifiedZoomThreshold { get; set; }

Property Value

double

MaxZoom

Maximum zoom level.

public double MaxZoom { get; set; }

Property Value

double

MinZoom

Minimum zoom level.

public double MinZoom { get; set; }

Property Value

double

NodeHeight

Height of nodes in pixels.

public double NodeHeight { get; set; }

Property Value

double

NodeWidth

Width of nodes in pixels.

public double NodeWidth { get; set; }

Property Value

double

PanOnDrag

Whether left-click drag on empty canvas pans (true) or starts box selection (false). When true, use Shift+drag for box selection. When false, use Shift+drag or middle-click for panning.

public bool PanOnDrag { get; set; }

Property Value

bool

PanOnScroll

Whether to pan the viewport when scrolling (mouse wheel without Ctrl). When true: scroll = pan, Ctrl+scroll = zoom When false: scroll = zoom (default behavior)

public bool PanOnScroll { get; set; }

Property Value

bool

PanOnScrollSpeed

Speed multiplier for pan-on-scroll behavior. Higher values result in faster panning.

public double PanOnScrollSpeed { get; set; }

Property Value

double

PortSize

Size of connection ports in pixels.

public double PortSize { get; set; }

Property Value

double

RenderBatchSize

Gets or sets the batch size for rendering nodes. When rendering large graphs, nodes are rendered in batches to keep the UI responsive. Set to 0 to disable batching (render all at once). Default is 50.

public int RenderBatchSize { get; set; }

Property Value

int

RouteEdgesOnDrag

Whether to re-route edges while dragging nodes. Only applies when AutoRouteEdges is enabled. Set to false for better performance with many edges.

public bool RouteEdgesOnDrag { get; set; }

Property Value

bool

RouteNewEdges

Whether to automatically route newly created edges. When true, edges created by connecting ports will be routed immediately.

public bool RouteNewEdges { get; set; }

Property Value

bool

RouteOnlyAffectedEdges

Whether to route only edges connected to dragged nodes during drag. When true, only affected edges are re-routed (better performance). When false, all edges are re-routed (more consistent but slower).

public bool RouteOnlyAffectedEdges { get; set; }

Property Value

bool

RoutingNodePadding

Padding around nodes for edge routing calculations. Higher values create more space between edges and nodes.

public double RoutingNodePadding { get; set; }

Property Value

double

RoutingOptions

Advanced routing options controlling corner radius, edge spacing, etc.

public EdgeRoutingOptions RoutingOptions { get; set; }

Property Value

EdgeRoutingOptions

Remarks

These options provide fine-grained control over edge routing behavior:

SelectionMode

Selection mode for box selection.

public SelectionMode SelectionMode { get; set; }

Property Value

SelectionMode

ShowBackground

Whether to show the built-in canvas background color. Set to false when using a custom FlowBackground control so it can show through.

public bool ShowBackground { get; set; }

Property Value

bool

ShowEdgeEndpointHandles

Whether to show draggable handles at edge endpoints for reconnecting/disconnecting edges.

public bool ShowEdgeEndpointHandles { get; set; }

Property Value

bool

ShowGrid

Whether to show the built-in grid background. Set to false when using a custom FlowBackground control.

public bool ShowGrid { get; set; }

Property Value

bool

ShowGroupHeaderBackground

Whether to show a distinct header background on groups. When true, the header area has a separate background color for visual separation. When false (default), the header blends with the group background.

public bool ShowGroupHeaderBackground { get; set; }

Property Value

bool

ShowGroupResizeHandle

Whether to show a visible resize handle on group corners. When true, a small corner grip is displayed for easier resizing. When false (default), resize uses invisible edge zones for a cleaner look.

public bool ShowGroupResizeHandle { get; set; }

Property Value

bool

ShowPorts

Whether to show port indicators on nodes. When false, ports still exist for edge routing but are not rendered visually. Useful for diagrams where connection points should be invisible.

public bool ShowPorts { get; set; }

Property Value

bool

SnapConnectionToNode

Whether to snap connections to nodes when dragging near them. When true, dragging near a node will find the nearest compatible port.

public bool SnapConnectionToNode { get; set; }

Property Value

bool

SnapGridSize

Grid size for snapping (can differ from visual grid). If null, uses GridSpacing.

public double? SnapGridSize { get; set; }

Property Value

double?

SnapToGrid

Whether to snap nodes to the grid when dragging.

public bool SnapToGrid { get; set; }

Property Value

bool

StrictConnectionDirection

Whether connections can only be started from output ports. When true (default), dragging from an input port will not start a new connection. When false, connections can be started from either input or output ports (bidirectional).

public bool StrictConnectionDirection { get; set; }

Property Value

bool

UseProxyPortsOnCollapse

Whether to use proxy ports when groups are collapsed. When true, edges that cross group boundaries are re-routed to proxy ports on the collapsed group, maintaining visual connectivity. When false (default), edges to/from hidden nodes are simply hidden.

public bool UseProxyPortsOnCollapse { get; set; }

Property Value

bool

UseSimplifiedNodeRendering

Gets or sets whether to use simplified node rendering for better performance. When enabled, nodes use a minimal visual tree (single Border + TextBlock). Recommended for graphs with 500+ nodes. Default is false.

public bool UseSimplifiedNodeRendering { get; set; }

Property Value

bool

ViewportBounds

Optional bounds to constrain panning. If set, the viewport cannot pan outside these bounds. Use null for unconstrained panning.

public Rect? ViewportBounds { get; set; }

Property Value

Rect?

ViewportBoundsPadding

Padding inside the viewport bounds. Only applies when ViewportBounds is set.

public double ViewportBoundsPadding { get; set; }

Property Value

double

VirtualizationBuffer

Gets or sets the buffer (in canvas coordinates) around the viewport for virtualization. Nodes within this buffer are still rendered even if slightly outside the viewport. This prevents "popping" during pan/zoom. Default is 200.

public double VirtualizationBuffer { get; set; }

Property Value

double

ZoomStep

Zoom increment per scroll step.

public double ZoomStep { get; set; }

Property Value

double

Methods

ApplyDiagnosticsSettings()

Applies the diagnostics settings to the global FlowGraphLogger. Call this after changing diagnostics settings.

public void ApplyDiagnosticsSettings()