Skip to content

CheckboxWidget

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

A checkbox widget that displays a toggleable checked/unchecked/indeterminate state.

csharp
public sealed record CheckboxWidget : Hex1bWidget, IEquatable<Hex1bWidget>, IEquatable<CheckboxWidget>

Inheritance

ObjectHex1bWidgetCheckboxWidget

Implements

Constructors

CheckboxWidget(CheckboxState)

A checkbox widget that displays a toggleable checked/unchecked/indeterminate state.

Parameters:

csharp
public CheckboxWidget(CheckboxState State = CheckboxState.Unchecked)

Properties

State

The current state of the checkbox.

Returns: CheckboxState

csharp
public CheckboxState State { get; init; }

Methods

Checked()

Sets the checkbox to checked state.

Returns: CheckboxWidget

csharp
public CheckboxWidget Checked()

Indeterminate()

Sets the checkbox to indeterminate state.

Returns: CheckboxWidget

csharp
public CheckboxWidget Indeterminate()

Label(string)

Sets the label displayed after the checkbox.

Parameters:

Returns: CheckboxWidget

csharp
public CheckboxWidget Label(string label)

OnToggled(Action<CheckboxToggledEventArgs>)

Sets a synchronous handler called when the checkbox is toggled.

Parameters:

Returns: CheckboxWidget

csharp
public CheckboxWidget OnToggled(Action<CheckboxToggledEventArgs> handler)

OnToggled(Func<CheckboxToggledEventArgs, Task>)

Sets an asynchronous handler called when the checkbox is toggled.

Parameters:

Returns: CheckboxWidget

csharp
public CheckboxWidget OnToggled(Func<CheckboxToggledEventArgs, Task> handler)

Unchecked()

Sets the checkbox to unchecked state.

Returns: CheckboxWidget

csharp
public CheckboxWidget Unchecked()

Fields

ToggleActionId

Action ID for toggling the checkbox state.

Returns: ActionId

csharp
public static readonly ActionId ToggleActionId

Released under the MIT License.