Button
ConsoleMonster.Interactive
A keyboard action button whose value counts activations.
Inheritance
- InputControl
- Button
Usage
Explore 16 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 8
- Extension method Button.WithEnabled
- Extension method Button.WithLabel
- Extension method Button.WithTabIndex
- Extension method Button.WithValidationMessage
- Method ButtonFluent.WithEnabled
- Method ButtonFluent.WithLabel
- Method ButtonFluent.WithTabIndex
- Method ButtonFluent.WithValidationMessage
Accepted by parameters 8
- Extension method Button.WithEnabled
- Extension method Button.WithLabel
- Extension method Button.WithTabIndex
- Extension method Button.WithValidationMessage
- Method ButtonFluent.WithEnabled
- Method ButtonFluent.WithLabel
- Method ButtonFluent.WithTabIndex
- Method ButtonFluent.WithValidationMessage
Constructors
public Button(string name, string? label = null) #Creates an action button.
Parameters
- name string
- The application-state key.
- label string? = null
- The caption; null uses the name.
Inherited Methods
public bool HandleInput(InputEvent input, RenderContext context) #Parameters
- input InputEvent
- context RenderContext
Returns
boolpublic Size Measure(Constraints constraints, RenderContext context) #Parameters
- constraints Constraints
- context RenderContext
Returns
Sizepublic void Render(Region region, RenderContext context) #Parameters
- region Region
- context RenderContext
Properties
public int Value { get; } #The number of handled Enter or Space activations, initially zero.
Inherited Properties
Events
public event EventHandler? Clicked #Raised synchronously once per activation, after releasing the control's state lock.
Inherited Events
public event EventHandler<AppValueChangedEventArgs>? Changed #Extension Methods
public static Button WithEnabled(Button button, bool value = true) #Sets InputControl.Enabled: Whether the control accepts input and participates in focus traversal.
Parameters
- button ConsoleMonster.Interactive.Button
- The instance.
- value bool = true
- The value (default true).
public static Button WithLabel(Button button, string? value) #Sets InputControl.Label: The visible label, or null to use the name.
Parameters
- button ConsoleMonster.Interactive.Button
- The instance.
- value string?
- The value.
public static Button WithTabIndex(Button button, int value) #Sets InputControl.TabIndex: Focus order; equal values preserve declaration order.
Parameters
- button ConsoleMonster.Interactive.Button
- The instance.
- value int
- The value.
public static Button WithValidationMessage(Button button, string? value) #Sets InputControl.ValidationMessage: The current validation message below the control, or null.
Parameters
- button ConsoleMonster.Interactive.Button
- The instance.
- value string?
- The value.