Skip to content

BackdropNode ​

Namespace: Hex1b.Nodes

Assembly: Hex1b.dll

Render node for . Fills available space, intercepts all input, and optionally renders a background.

csharp
public sealed class BackdropNode : Hex1bNode

Inheritance ​

Object → Hex1bNode → BackdropNode

Properties ​

BackgroundColor ​

The optional background color for the backdrop (used when Style is Opaque).

Returns: Nullable<Hex1bColor>

csharp
public Hex1bColor? BackgroundColor { get; set; }

Child ​

The optional child node to render on top of the backdrop.

Returns: Hex1bNode

csharp
public Hex1bNode? Child { get; set; }

ClickAwayEventHandler ​

Rich callback with event args for click-away behavior.

Returns: Func<BackdropClickedEventArgs, Task>

csharp
public Func<BackdropClickedEventArgs, Task>? ClickAwayEventHandler { get; set; }

ClickAwayHandler ​

Simple callback for click-away behavior.

Returns: Func<Task>

csharp
public Func<Task>? ClickAwayHandler { get; set; }

IsFocusable ​

Backdrop is always focusable so it can intercept clicks.

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; }

LayerId ​

Optional layer identifier for popup stack management.

Returns: String

csharp
public string? LayerId { get; set; }

SourceWidget ​

The source widget for creating event args.

Returns: BackdropWidget

csharp
public BackdropWidget? SourceWidget { get; set; }

Style ​

The visual style for the backdrop.

Returns: BackdropStyle

csharp
public BackdropStyle Style { 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 bounds)

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)

GetChildren() ​

Gets the direct children of this node for structural 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()

HandleMouseClick(int, int, Hex1bMouseEvent) ​

Handles a mouse click event (after mouse bindings have been checked). Override this in nodes to handle clicks that weren't matched by any mouse binding. The coordinates in the event are local to this node's bounds (0,0 is top-left of node).

Parameters:

  • localX (Int32): The X coordinate relative to this node's bounds.
  • localY (Int32): The Y coordinate relative to this node's bounds.
  • mouseEvent (Hex1bMouseEvent): The original mouse event (with absolute coordinates).

Returns: InputResult

Handled if the click was consumed, NotHandled otherwise.

csharp
public override InputResult HandleMouseClick(int localX, int localY, Hex1bMouseEvent mouseEvent)

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.