Skip to content

ReconcileContext ​

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

Context passed to widget reconciliation methods, providing access to child reconciliation and focus management utilities.

csharp
public sealed class ReconcileContext

Inheritance ​

Object → ReconcileContext

Properties ​

CancellationToken ​

The cancellation token for the current render frame. Composite widgets that perform async work should observe this token.

Returns: CancellationToken

csharp
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>

csharp
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>

csharp
public int? ChildIndex { get; }

IsNew ​

Whether this is a new node being created (vs updating an existing one).

Returns: Boolean

csharp
public bool IsNew { get; }

LayoutAxis ​

The layout axis of the parent container (if any). Used by SeparatorWidget to determine orientation.

Returns: Nullable<LayoutAxis>

csharp
public LayoutAxis? LayoutAxis { get; }

Parent ​

The parent node in the tree (used for focus management decisions).

Returns: Hex1bNode

csharp
public Hex1bNode? Parent { get; }

Methods ​

IsNodeFocused(Hex1bNode) ​

Checks if a node currently has focus. Uses the virtual IsFocused property on Hex1bNode.

Parameters:

Returns: Boolean

csharp
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

csharp
public bool ParentManagesFocus()

ReconcileChildAsync(Hex1bNode?, Hex1bWidget?, Hex1bNode) ​

Reconciles a child widget asynchronously, returning the updated or new node.

Parameters:

Returns: Task<Hex1bNode>

csharp
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:

csharp
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:

csharp
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

csharp
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:

Returns: ReconcileContext

csharp
public ReconcileContext WithLayoutAxis(LayoutAxis axis)

Released under the MIT License.