CheckboxWidget
Namespace: Hex1b.Widgets
Assembly: Hex1b.dll
A checkbox widget that displays a toggleable checked/unchecked/indeterminate state.
public sealed record CheckboxWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<CheckboxWidget>Inheritance
Object → Hex1bWidget → CheckboxWidget
Implements
Constructors
CheckboxWidget(CheckboxState)
A checkbox widget that displays a toggleable checked/unchecked/indeterminate state.
Parameters:
State(CheckboxState): The current state of the checkbox.
public CheckboxWidget(CheckboxState State = CheckboxState.Unchecked)Properties
State
The current state of the checkbox.
Returns: CheckboxState
public CheckboxState State { get; init; }Methods
Checked()
Sets the checkbox to checked state.
Returns: CheckboxWidget
public CheckboxWidget Checked()Indeterminate()
Sets the checkbox to indeterminate state.
Returns: CheckboxWidget
public CheckboxWidget Indeterminate()Label(string)
Sets the label displayed after the checkbox.
Parameters:
label(String):
Returns: CheckboxWidget
public CheckboxWidget Label(string label)OnToggled(Action<CheckboxToggledEventArgs>)
Sets a synchronous handler called when the checkbox is toggled.
Parameters:
handler(Action<CheckboxToggledEventArgs>):
Returns: CheckboxWidget
public CheckboxWidget OnToggled(Action<CheckboxToggledEventArgs> handler)OnToggled(Func<CheckboxToggledEventArgs, Task>)
Sets an asynchronous handler called when the checkbox is toggled.
Parameters:
handler(Func<CheckboxToggledEventArgs, Task>):
Returns: CheckboxWidget
public CheckboxWidget OnToggled(Func<CheckboxToggledEventArgs, Task> handler)Unchecked()
Sets the checkbox to unchecked state.
Returns: CheckboxWidget
public CheckboxWidget Unchecked()Fields
ToggleActionId
Action ID for toggling the checkbox state.
Returns: ActionId
public static readonly ActionId ToggleActionId