BackdropWidget
Namespace: Hex1b.Widgets
Assembly: Hex1b.dll
A widget that fills its available space and intercepts all input. Used as a modal backdrop to prevent interaction with layers below. Can optionally display a background color (for dimming effects) and trigger a callback when clicked (for "click-away to dismiss" behavior).
public sealed record BackdropWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<BackdropWidget>Inheritance
Object → Hex1bWidget → BackdropWidget
Implements
Constructors
BackdropWidget(Hex1bWidget?)
A widget that fills its available space and intercepts all input. Used as a modal backdrop to prevent interaction with layers below. Can optionally display a background color (for dimming effects) and trigger a callback when clicked (for "click-away to dismiss" behavior).
Parameters:
Child(Hex1bWidget): Optional child widget to display on top of the backdrop.
public BackdropWidget(Hex1bWidget? Child = null)Properties
Child
Optional child widget to display on top of the backdrop.
Returns: Hex1bWidget
public Hex1bWidget? Child { get; init; }Methods
OnClickAway(Action)
Sets a simple callback to be invoked when clicking on the backdrop (outside child content).
Parameters:
handler(Action): The click-away handler.
Returns: BackdropWidget
A new BackdropWidget with the handler set.
public BackdropWidget OnClickAway(Action handler)OnClickAway(Action<BackdropClickedEventArgs>)
Sets a rich callback with event args to be invoked when clicking on the backdrop. The event args include click coordinates and the layer ID for popup stack integration.
Parameters:
handler(Action<BackdropClickedEventArgs>): The click-away event handler.
Returns: BackdropWidget
A new BackdropWidget with the handler set.
public BackdropWidget OnClickAway(Action<BackdropClickedEventArgs> handler)OnClickAway(Func<BackdropClickedEventArgs, Task>)
Sets a rich async callback with event args to be invoked when clicking on the backdrop. The event args include click coordinates and the layer ID for popup stack integration.
Parameters:
handler(Func<BackdropClickedEventArgs, Task>): The async click-away event handler.
Returns: BackdropWidget
A new BackdropWidget with the handler set.
public BackdropWidget OnClickAway(Func<BackdropClickedEventArgs, Task> handler)OnClickAway(Func<Task>)
Sets a simple async callback to be invoked when clicking on the backdrop (outside child content).
Parameters:
handler(Func<Task>): The async click-away handler.
Returns: BackdropWidget
A new BackdropWidget with the handler set.
public BackdropWidget OnClickAway(Func<Task> handler)Opaque(Hex1bColor)
Sets the backdrop to opaque mode with the specified background color.
Parameters:
color(Hex1bColor): The background color.
Returns: BackdropWidget
A new BackdropWidget with opaque style.
public BackdropWidget Opaque(Hex1bColor color)Transparent()
Sets the backdrop to transparent mode - base layer shows through unchanged.
Returns: BackdropWidget
A new BackdropWidget with transparent style.
public BackdropWidget Transparent()WithBackground(Hex1bColor)
Sets the background color for the backdrop (implies opaque mode).
Parameters:
color(Hex1bColor): The background color.
Returns: BackdropWidget
A new BackdropWidget with the background color set.
public BackdropWidget WithBackground(Hex1bColor color)WithLayerId(string)
Sets a layer identifier for this backdrop. Used by PopupStack to identify which layer was clicked.
Parameters:
id(String): The layer identifier.
Returns: BackdropWidget
A new BackdropWidget with the layer ID set.
public BackdropWidget WithLayerId(string id)Fields
ClickAwayAction
Returns: ActionId
public static readonly ActionId ClickAwayActionDismissAction
Returns: ActionId
public static readonly ActionId DismissAction