Interface ICanvasRenderService
Unified interface for graph rendering operations that abstracts away the difference between retained mode (VisualTree) and direct rendering modes. This prevents the recurring issue of handlers only implementing one rendering path.
public interface ICanvasRenderService
Properties
IsDirectRenderingMode
Gets whether the renderer is currently in direct rendering mode.
bool IsDirectRenderingMode { get; }
Property Value
Methods
Invalidate()
Invalidates the render and schedules a repaint. For retained mode, this updates visuals. For direct mode, this triggers InvalidateVisual().
void Invalidate()
Refresh()
Forces an immediate refresh/re-render of all graph elements. Use sparingly as this can be expensive.
void Refresh()
RenderEdges()
Re-renders all edges. Call this after node position/size changes.
void RenderEdges()
UpdateNodeAfterMove(Node)
Updates all visual aspects of a node after a move operation. This is more efficient than calling individual update methods. In direct mode, this triggers a single invalidation. In retained mode, this updates position, handles, and edges.
void UpdateNodeAfterMove(Node node)
Parameters
nodeNodeThe node that was moved.
UpdateNodeAfterResize(Node)
Updates all visual aspects of a node after a resize operation. This is more efficient than calling individual update methods. In direct mode, this triggers a single invalidation. In retained mode, this updates size, position, handles, and edges.
void UpdateNodeAfterResize(Node node)
Parameters
nodeNodeThe node that was resized.
UpdateNodePosition(Node)
Updates the visual position of a node. Works in both rendering modes.
void UpdateNodePosition(Node node)
Parameters
nodeNodeThe node to update.
UpdateNodeSelection(Node)
Updates the selection state of a node. Works in both rendering modes.
void UpdateNodeSelection(Node node)
Parameters
nodeNodeThe node to update.
UpdateNodeSize(Node)
Updates the visual size of a node. Works in both rendering modes.
void UpdateNodeSize(Node node)
Parameters
nodeNodeThe node to update.
UpdateNodeStyle(Node)
Updates the custom style of a node based on its Data property. Call this when node.Data changes and may affect visual appearance.
void UpdateNodeStyle(Node node)
Parameters
nodeNodeThe node to update.
UpdateResizeHandlePositions(Node)
Updates the resize handle positions for a node. Works in both rendering modes.
void UpdateResizeHandlePositions(Node node)
Parameters
nodeNodeThe node to update handles for.