BackdropNode
Namespace: Hex1b.Nodes
Assembly: Hex1b.dll
Render node for . Fills available space, intercepts all input, and optionally renders a background.
public sealed class BackdropNode : Hex1bNodeInheritance
Object → Hex1bNode → BackdropNode
Properties
BackgroundColor
The optional background color for the backdrop (used when Style is Opaque).
Returns: Nullable<Hex1bColor>
public Hex1bColor? BackgroundColor { get; set; }Child
The optional child node to render on top of the backdrop.
Returns: Hex1bNode
public Hex1bNode? Child { get; set; }ClickAwayEventHandler
Rich callback with event args for click-away behavior.
Returns: Func<BackdropClickedEventArgs, Task>
public Func<BackdropClickedEventArgs, Task>? ClickAwayEventHandler { get; set; }ClickAwayHandler
Simple callback for click-away behavior.
Returns: Func<Task>
public Func<Task>? ClickAwayHandler { get; set; }IsFocusable
Backdrop is always focusable so it can intercept clicks.
Returns: Boolean
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
public override bool IsFocused { get; set; }LayerId
Optional layer identifier for popup stack management.
Returns: String
public string? LayerId { get; set; }SourceWidget
The source widget for creating event args.
Returns: BackdropWidget
public BackdropWidget? SourceWidget { get; set; }Style
The visual style for the backdrop.
Returns: BackdropStyle
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:
bounds(Rect):
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:
bindings(InputBindingsBuilder): The builder to add bindings to.
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>
public override IEnumerable<Hex1bNode> GetChildren()GetFocusableNodes()
Gets all focusable nodes in this subtree (including this node if focusable).
Returns: IEnumerable<Hex1bNode>
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.
public override InputResult HandleMouseClick(int localX, int localY, Hex1bMouseEvent mouseEvent)MeasureCore(Constraints)
Override this method to implement measuring logic for this node.
Parameters:
constraints(Constraints):
Returns: Size
protected override Size MeasureCore(Constraints constraints)Render(Hex1bRenderContext)
Renders the node to the given context.
Parameters:
context(Hex1bRenderContext):
public override void Render(Hex1bRenderContext context)