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
nodeNodeThe node to render.
processorINodeProcessorThe node's data processor (may be null for display-only nodes).
contextNodeRenderContextThe 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
rootControlThe root control to search from.
Returns
- IEnumerable<T>
All matching controls.
Type Parameters
TThe 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
rootControlThe root control to search from.
tagstringThe tag value to match.
Returns
- T
The found control, or null.
Type Parameters
TThe 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
visualControlThe 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
visualControlThe node's visual control.
processorINodeProcessorThe 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
visualControlThe node's visual control.
processorINodeProcessorThe 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
visualControlThe node's visual control.
processorINodeProcessorThe node's processor.