Class FlowCanvasSettings
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
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
AutoRouteEdges
Whether automatic edge routing is enabled. When enabled, edges will be routed around obstacles automatically.
public bool AutoRouteEdges { get; set; }
Property Value
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
DebugCoordinateTransforms
Whether to output debug information for coordinate transformations.
public bool DebugCoordinateTransforms { get; set; }
Property Value
Default
Default settings instance.
public static FlowCanvasSettings Default { get; }
Property Value
DefaultEdgeType
The default edge type to use for newly created edges.
public EdgeType DefaultEdgeType { get; set; }
Property Value
DefaultRouterAlgorithm
The default router algorithm to use for routing.
public RouterAlgorithm DefaultRouterAlgorithm { get; set; }
Property Value
DiagnosticsCategories
Gets or sets the categories to include in diagnostics. Use bitwise OR to combine categories.
public LogCategory DiagnosticsCategories { get; set; }
Property Value
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
DiagnosticsMinimumLevel
Gets or sets the minimum log level for diagnostics. Messages below this level are ignored.
public LogLevel DiagnosticsMinimumLevel { get; set; }
Property Value
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
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
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
EdgeSelectedStrokeThickness
Stroke thickness for selected edges.
public double EdgeSelectedStrokeThickness { get; set; }
Property Value
EdgeStrokeThickness
Stroke thickness for normal (unselected) edges.
public double EdgeStrokeThickness { get; set; }
Property Value
EffectiveSnapGridSize
Gets the effective snap grid size.
public double EffectiveSnapGridSize { get; }
Property Value
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
EnableDiagnostics
Gets or sets whether diagnostic logging is enabled. When enabled, FlowGraph will emit detailed diagnostic information.
public bool EnableDiagnostics { get; set; }
Property Value
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
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
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
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
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
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
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
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
GridDotSize
Size of grid dots in pixels.
public double GridDotSize { get; set; }
Property Value
GridSpacing
Spacing between grid dots in pixels.
public double GridSpacing { get; set; }
Property Value
GroupBackgroundOpacity
Opacity of the group background (0.0 to 1.0). Lower values create more translucent groups.
public double GroupBackgroundOpacity { get; set; }
Property Value
GroupBorderRadius
Border radius for group corners.
public double GroupBorderRadius { get; set; }
Property Value
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
GroupHeaderHeight
Height of the group header area.
public double GroupHeaderHeight { get; set; }
Property Value
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
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
GroupUseDashedBorder
Whether to use dashed borders for groups (React Flow style).
public bool GroupUseDashedBorder { get; set; }
Property Value
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
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
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
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
MaxZoom
Maximum zoom level.
public double MaxZoom { get; set; }
Property Value
MinZoom
Minimum zoom level.
public double MinZoom { get; set; }
Property Value
NodeHeight
Height of nodes in pixels.
public double NodeHeight { get; set; }
Property Value
NodeWidth
Width of nodes in pixels.
public double NodeWidth { get; set; }
Property Value
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
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
PanOnScrollSpeed
Speed multiplier for pan-on-scroll behavior. Higher values result in faster panning.
public double PanOnScrollSpeed { get; set; }
Property Value
PortSize
Size of connection ports in pixels.
public double PortSize { get; set; }
Property Value
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
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
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
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
RoutingNodePadding
Padding around nodes for edge routing calculations. Higher values create more space between edges and nodes.
public double RoutingNodePadding { get; set; }
Property Value
RoutingOptions
Advanced routing options controlling corner radius, edge spacing, etc.
public EdgeRoutingOptions RoutingOptions { get; set; }
Property Value
Remarks
These options provide fine-grained control over edge routing behavior:
- CornerRadius - Rounding for SmoothStep edges
- EndSegmentLength - Stem length from ports
- EdgeSpacing - Gap between edges from same port
SelectionMode
Selection mode for box selection.
public SelectionMode SelectionMode { get; set; }
Property Value
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
ShowEdgeEndpointHandles
Whether to show draggable handles at edge endpoints for reconnecting/disconnecting edges.
public bool ShowEdgeEndpointHandles { get; set; }
Property Value
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
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
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
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
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
SnapGridSize
Grid size for snapping (can differ from visual grid). If null, uses GridSpacing.
public double? SnapGridSize { get; set; }
Property Value
SnapToGrid
Whether to snap nodes to the grid when dragging.
public bool SnapToGrid { get; set; }
Property Value
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
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
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
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
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
ZoomStep
Zoom increment per scroll step.
public double ZoomStep { get; set; }
Property Value
Methods
ApplyDiagnosticsSettings()
Applies the diagnostics settings to the global FlowGraphLogger. Call this after changing diagnostics settings.
public void ApplyDiagnosticsSettings()