Skip to content

PickerNode

Namespace: Hex1b

Assembly: Hex1b.dll

Render node for PickerWidget. Manages the picker's selection state and popup display.

csharp
public sealed class PickerNode : Hex1bNode

Inheritance

ObjectHex1bNodePickerNode

Properties

ContentChild

The reconciled content child node. This is the root of the widget tree built by the picker widget.

Returns: Hex1bNode

csharp
public Hex1bNode? ContentChild { get; set; }

IsFocusable

Picker nodes are NOT themselves focusable - focus passes through to children.

Returns: Boolean

csharp
public override bool IsFocusable { get; }

IsFocused

Focus state exists on the content child, not the picker node itself.

Returns: Boolean

csharp
public override bool IsFocused { get; set; }

Items

The list of items available for selection.

Returns: IReadOnlyList<String>

csharp
public IReadOnlyList<string> Items { get; set; }

SelectedIndex

The index of the currently selected item. This value is owned by the node and preserved across reconciliation.

Returns: Int32

csharp
public int SelectedIndex { get; set; }

SelectedText

Gets the text of the currently selected item, or empty string if no items.

Returns: String

csharp
public string SelectedText { get; }

SelectionChangedAction

Callback invoked when selection changes.

Returns: Func<InputBindingActionContext, Task>

csharp
public Func<InputBindingActionContext, Task>? SelectionChangedAction { get; set; }

Methods

ArrangeCore(Rect)

Override this method to implement arranging logic for this node. The base implementation saves previous bounds, marks dirty on change, and sets bounds.

Parameters:

csharp
protected override void ArrangeCore(Rect rect)

GetChildren()

Gets the direct children of this node. Used for input routing and tree traversal. Container nodes should override this to return their children.

Returns: IEnumerable<Hex1bNode>

csharp
public override IEnumerable<Hex1bNode> GetChildren()

GetFocusableNodes()

Gets all focusable nodes in this subtree (including this node if focusable).

Returns: IEnumerable<Hex1bNode>

csharp
public override IEnumerable<Hex1bNode> GetFocusableNodes()

MeasureCore(Constraints)

Override this method to implement measuring logic for this node.

Parameters:

Returns: Size

csharp
protected override Size MeasureCore(Constraints constraints)

Render(Hex1bRenderContext)

Renders the node to the given context.

Parameters:

csharp
public override void Render(Hex1bRenderContext context)

SelectItemAsync(int, InputBindingActionContext)

Selects an item by index and dismisses the popup.

Parameters:

Returns: Task

csharp
public Task SelectItemAsync(int index, InputBindingActionContext context)

Released under the MIT License.