Skip to content

MenuItemNode

Namespace: Hex1b

Assembly: Hex1b.dll

Render node for MenuItemWidget. Focusable item that triggers an action when activated.

csharp
public sealed class MenuItemNode : Hex1bNode

Inheritance

ObjectHex1bNodeMenuItemNode

Properties

Accelerator

The accelerator character for this item (uppercase).

Returns: Nullable<Char>

csharp
public char? Accelerator { get; set; }

AcceleratorIndex

The index of the accelerator character in the label.

Returns: Int32

csharp
public int AcceleratorIndex { get; set; }

ActivatedAction

The action to execute when the item is activated.

Returns: Func<InputBindingActionContext, Task>

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

IsDisabled

Whether the item is disabled (grayed out and non-interactive).

Returns: Boolean

csharp
public bool IsDisabled { get; set; }

IsFallbackFocusable

When true, this disabled item acts as a fallback focus target to allow navigation out of a menu that has no other focusable items.

Returns: Boolean

csharp
public bool IsFallbackFocusable { get; set; }

IsFocusable

Returns true if this node can receive focus.

Returns: Boolean

csharp
public override bool IsFocusable { get; }

IsFocused

Gets or sets whether this node is currently focused. Only meaningful for focusable nodes (where IsFocusable is true).

Returns: Boolean

csharp
public override bool IsFocused { get; set; }

IsHovered

Gets or sets whether the mouse is currently hovering over this node. Set by Hex1bApp based on mouse position during each frame. Only set on focusable nodes (tracked via FocusRing hit testing).

Returns: Boolean

csharp
public override bool IsHovered { get; set; }

Label

The display label for the item.

Returns: String

csharp
public string Label { get; set; }

RenderWidth

The width to render (set by parent MenuNode during layout).

Returns: Int32

csharp
public int RenderWidth { get; set; }

SourceWidget

The source widget that was reconciled into this node.

Returns: MenuItemWidget

csharp
public MenuItemWidget? SourceWidget { get; set; }

Methods

ConfigureDefaultBindings(InputBindingsBuilder)

Configures the default input bindings for this node type. Override in derived classes to add default key bindings. These bindings can be inspected and modified by the user's callback.

Parameters:

csharp
public override void ConfigureDefaultBindings(InputBindingsBuilder bindings)

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)

Released under the MIT License.