Skip to content

WidgetEventArgs<TWidget, TNode> ​

Namespace: Hex1b.Events

Assembly: Hex1b.dll

Strongly-typed base class for widget event arguments. Provides typed access to both the widget configuration and the node instance.

csharp
public abstract class WidgetEventArgs<TWidget, TNode> : WidgetEventArgs where TWidget : Hex1bWidget where TNode : Hex1bNode

Inheritance ​

Object → WidgetEventArgs → WidgetEventArgs<TWidget, TNode>

Constructors ​

WidgetEventArgs(TWidget, TNode, InputBindingActionContext) ​

Parameters:

csharp
protected WidgetEventArgs(TWidget widget, TNode node, InputBindingActionContext context)

Properties ​

Node ​

The node instance that raised this event. This is the mutable stateful object that manages the widget's lifecycle.

Returns: <TNode>

csharp
public TNode Node { get; }

Widget ​

The widget configuration that triggered this event. This is the immutable record describing the UI element.

Returns: <TWidget>

csharp
public TWidget Widget { get; }

Methods ​

PushAnchored(AnchorPosition, Func<Hex1bWidget>) ​

Pushes an anchored popup positioned relative to the node that triggered this event. This is a convenience method for the common pattern of anchoring a menu to the clicked button. When the popup is dismissed, focus will be restored to the node that was focused when the popup was opened.

Parameters:

  • position (AnchorPosition): Where to position the popup relative to this node.
  • contentBuilder (Func<Hex1bWidget>): A function that builds the widget content for the popup.

Returns: PopupEntry

The popup entry for optional fluent configuration (e.g., .AsBarrier()).

csharp
public PopupEntry PushAnchored(AnchorPosition position, Func<Hex1bWidget> contentBuilder)

PushAnchored(AnchorPosition, Hex1bWidget) ​

Pushes an anchored popup positioned relative to the node that triggered this event. This is a convenience method for the common pattern of anchoring a menu to the clicked button. When the popup is dismissed, focus will be restored to the node that was focused when the popup was opened.

Parameters:

  • position (AnchorPosition): Where to position the popup relative to this node.
  • content (Hex1bWidget): The widget content for the popup.

Returns: PopupEntry

The popup entry for optional fluent configuration (e.g., .AsBarrier()).

csharp
public PopupEntry PushAnchored(AnchorPosition position, Hex1bWidget content)

Released under the MIT License.