Table of Contents

Class DataNodeRendererBase

Namespace
FlowGraph.Avalonia.Rendering.NodeRenderers
Assembly
FlowGraph.Avalonia.dll

Base class for data-bound node renderers. Provides common functionality for interactive nodes.

public abstract class DataNodeRendererBase : DefaultNodeRenderer, IEditableNodeRenderer, IDataNodeRenderer, INodeRenderer
Inheritance
DataNodeRendererBase
Implements
Derived
Inherited Members

Methods

CreateDataBoundVisual(Node, INodeProcessor?, NodeRenderContext)

Creates the visual with data binding context.

public virtual Control CreateDataBoundVisual(Node node, INodeProcessor? processor, NodeRenderContext context)

Parameters

node Node

The node to render.

processor INodeProcessor

The node's data processor (may be null for display-only nodes).

context NodeRenderContext

The render context.

Returns

Control

A control bound to the node's data.

FindAll<T>(Control)

Finds all controls of a type within a visual tree.

protected static IEnumerable<T> FindAll<T>(Control root) where T : Control

Parameters

root Control

The root control to search from.

Returns

IEnumerable<T>

All matching controls.

Type Parameters

T

The control type to find.

FindByTag<T>(Control, string)

Finds a control by its Tag property.

protected static T? FindByTag<T>(Control root, string tag) where T : Control

Parameters

root Control

The root control to search from.

tag string

The tag value to match.

Returns

T

The found control, or null.

Type Parameters

T

The control type to find.

GetNodeFromVisual(Control)

Gets the Node associated with a visual control. Handles both direct Tag assignment and ResizableVisual dictionary storage. Use this method instead of directly accessing visual.Tag for Node lookups.

protected static Node? GetNodeFromVisual(Control visual)

Parameters

visual Control

The visual control to get the node from.

Returns

Node

The associated Node, or null if not found.

OnProcessorAttached(Control, INodeProcessor)

Called when the processor is attached to this renderer. Use this to set up event subscriptions.

public virtual void OnProcessorAttached(Control visual, INodeProcessor processor)

Parameters

visual Control

The node's visual control.

processor INodeProcessor

The node's processor.

OnProcessorDetached(Control, INodeProcessor)

Called when the processor is detached from this renderer. Use this to clean up event subscriptions.

public virtual void OnProcessorDetached(Control visual, INodeProcessor processor)

Parameters

visual Control

The node's visual control.

processor INodeProcessor

The node's processor.

UpdateFromPortValues(Control, INodeProcessor)

Updates the visual when port values change. Called when connected input values change.

public virtual void UpdateFromPortValues(Control visual, INodeProcessor processor)

Parameters

visual Control

The node's visual control.

processor INodeProcessor

The node's processor.