Skip to content

ButtonWidget ​

Namespace: Hex1b.Widgets

Assembly: Hex1b.dll

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

Inheritance ​

Object → Hex1bWidget → ButtonWidget

Implements ​

Constructors ​

ButtonWidget(string) ​

Parameters:

csharp
public ButtonWidget(string Label)

Properties ​

Label ​

Returns: String

csharp
public string Label { get; init; }

Methods ​

OnClick(Action<ButtonClickedEventArgs>) ​

Sets a synchronous click handler. Called when the button is activated via Enter, Space, or mouse click.

Parameters:

Returns: ButtonWidget

csharp
public ButtonWidget OnClick(Action<ButtonClickedEventArgs> handler)

OnClick(Func<ButtonClickedEventArgs, Task>) ​

Sets an asynchronous click handler. Called when the button is activated via Enter, Space, or mouse click.

Parameters:

Returns: ButtonWidget

csharp
public ButtonWidget OnClick(Func<ButtonClickedEventArgs, Task> handler)

Fields ​

Activate ​

Rebindable action: Activate the button.

Returns: ActionId

csharp
public static readonly ActionId Activate

Released under the MIT License.