ReconcileContext
Namespace: Hex1b.Widgets
Assembly: Hex1b.dll
Context passed to widget reconciliation methods, providing access to child reconciliation and focus management utilities.
public sealed class ReconcileContextInheritance
Object → ReconcileContext
Properties
CancellationToken
The cancellation token for the current render frame. Composite widgets that perform async work should observe this token.
Returns: CancellationToken
public CancellationToken CancellationToken { get; }ChildCount
The total number of children in the parent container (if known). Used by DrawerWidget for direction auto-detection.
Returns: Nullable<Int32>
public int? ChildCount { get; }ChildIndex
The index of this child within the parent container (if known). Used by DrawerWidget for direction auto-detection.
Returns: Nullable<Int32>
public int? ChildIndex { get; }IsNew
Whether this is a new node being created (vs updating an existing one).
Returns: Boolean
public bool IsNew { get; }LayoutAxis
The layout axis of the parent container (if any). Used by SeparatorWidget to determine orientation.
Returns: Nullable<LayoutAxis>
public LayoutAxis? LayoutAxis { get; }Parent
The parent node in the tree (used for focus management decisions).
Returns: Hex1bNode
public Hex1bNode? Parent { get; }Methods
IsNodeFocused(Hex1bNode)
Checks if a node currently has focus. Uses the virtual IsFocused property on Hex1bNode.
Parameters:
node(Hex1bNode):
Returns: Boolean
public static bool IsNodeFocused(Hex1bNode node)ParentManagesFocus()
Returns true if the parent node (or any ancestor) manages focus for its children. When a parent manages focus, child containers should NOT set initial focus.
Returns: Boolean
public bool ParentManagesFocus()ReconcileChildAsync(Hex1bNode?, Hex1bWidget?, Hex1bNode)
Reconciles a child widget asynchronously, returning the updated or new node.
Parameters:
existingNode(Hex1bNode):widget(Hex1bWidget):parent(Hex1bNode):
Returns: Task<Hex1bNode>
public Task<Hex1bNode?> ReconcileChildAsync(Hex1bNode? existingNode, Hex1bWidget? widget, Hex1bNode parent)SetNodeFocus(Hex1bNode, bool)
Sets focus on a node. Uses the virtual IsFocused property on Hex1bNode.
Parameters:
public static void SetNodeFocus(Hex1bNode node, bool focused)SyncContainerFocusIndices(Hex1bNode)
Recursively syncs focus indices on container nodes after focus has been set. Uses the virtual SyncFocusIndex method on Hex1bNode.
Parameters:
node(Hex1bNode):
public static void SyncContainerFocusIndices(Hex1bNode node)WithChildPosition(int, int)
Creates a new context with child position info for direction auto-detection. Used by HStack and VStack when reconciling children.
Parameters:
Returns: ReconcileContext
public ReconcileContext WithChildPosition(int index, int count)WithLayoutAxis(LayoutAxis)
Creates a new context with the specified layout axis. Used by VStack and HStack to inform children of the layout direction.
Parameters:
axis(LayoutAxis):
Returns: ReconcileContext
public ReconcileContext WithLayoutAxis(LayoutAxis axis)