Class MudCheckBox<T>
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
Represents a form input for boolean values or selecting multiple items in a list.
public class MudCheckBox<T> : MudBooleanInput<T>, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IFormComponent, IAsyncDisposable
Type Parameters
T
The type of item managed by this checkbox.
- Inheritance
-
MudFormComponent<T, bool?>MudCheckBox<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
MudCheckBox()
public MudCheckBox()
Properties
CheckedIcon
The icon to display for a checked state.
[Parameter]
[Category("Appearance")]
public string CheckedIcon { get; set; }
Property Value
Remarks
Defaults to CheckBox.
Classname
protected override string Classname { get; }
Property Value
Dense
Uses compact padding.
[Parameter]
[Category("Appearance")]
public bool Dense { get; set; }
Property Value
Remarks
Defaults to false
.
IconClassname
protected override string IconClassname { get; }
Property Value
IndeterminateIcon
The icon to display for an indeterminate state.
[Parameter]
[Category("Appearance")]
public string IndeterminateIcon { get; set; }
Property Value
Remarks
Defaults to IndeterminateCheckBox.
KeyboardEnabled
Allows this checkbox to be controlled via the keyboard.
[Parameter]
[Category("Behavior")]
public bool KeyboardEnabled { get; set; }
Property Value
Remarks
Defaults to true
. The Space
key cycles through true and false values (or true/false/null states if TriState is true
). Delete
will clear the checkbox. Enter
(or NumPadEnter
) will set the checkbox. Backspace
will set an indeterminate value.
LabelClassname
protected override string LabelClassname { get; }
Property Value
TriState
Allows the checkbox to have an indeterminate state.
[Parameter]
[Category("Validation")]
public bool TriState { get; set; }
Property Value
Remarks
Defaults to false
. When true
, the checkbox can support an indeterminate state such as a null
value, in addition to true
and false
.
UncheckedColor
The color of the checkbox when its Value
is false
or null
.
[Parameter]
[Category("Appearance")]
public Color? UncheckedColor { get; set; }
Property Value
Remarks
Defaults to null
. Theme colors are supported.
UncheckedIcon
The icon to display for an unchecked state.
[Parameter]
[Category("Appearance")]
public string UncheckedIcon { get; set; }
Property Value
Remarks
Defaults to CheckBoxOutlineBlank.
Methods
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
DisposeAsyncCore()
Called to dispose this instance.
protected override ValueTask DisposeAsyncCore()
Returns
HandleKeyDownAsync(KeyboardEventArgs)
protected Task HandleKeyDownAsync(KeyboardEventArgs obj)
Parameters
Returns
OnAfterRenderAsync(bool)
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
firstRender
bool
Returns
OnChange(ChangeEventArgs)
protected override Task OnChange(ChangeEventArgs args)
Parameters
args
ChangeEventArgs
Returns
OnInitialized()
protected override void OnInitialized()