Class MudBooleanInput<T>
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
Represents a form input component which stores a boolean value.
public class MudBooleanInput<T> : MudFormComponent<T?, bool?>, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IFormComponent, IAsyncDisposable
Type Parameters
T
The type of item managed by this component.
- Inheritance
-
MudFormComponent<T, bool?>MudBooleanInput<T>
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
MudBooleanInput()
public MudBooleanInput()
Properties
BoolValue
protected bool? BoolValue { get; }
Property Value
- bool?
ChildContent
[Parameter]
[Category("Behavior")]
public RenderFragment? ChildContent { get; set; }
Property Value
Classname
protected virtual string? Classname { get; set; }
Property Value
Color
The color of the component. It supports the theme colors.
[Parameter]
[Category("Appearance")]
public Color Color { get; set; }
Property Value
Disabled
Prevents the user from interacting with this input.
[Parameter]
[Category("Behavior")]
public bool Disabled { get; set; }
Property Value
Remarks
Defaults to false
.
IconClassname
protected virtual string? IconClassname { get; set; }
Property Value
Label
The text/label will be displayed next to the switch if set.
[Parameter]
[Category("Appearance")]
public string? Label { get; set; }
Property Value
LabelClassname
protected virtual string? LabelClassname { get; set; }
Property Value
LabelPlacement
The location of the label relative to the input icon.
[Parameter]
[Category("Appearance")]
public Placement LabelPlacement { get; set; }
Property Value
ReadOnly
Prevents the user from changing the input.
[Parameter]
[Category("Behavior")]
public bool ReadOnly { get; set; }
Property Value
Remarks
Defaults to false
. When true
, the user can copy the input but cannot change it.
RightToLeft
[CascadingParameter(Name = "RightToLeft")]
public bool RightToLeft { get; set; }
Property Value
Ripple
Gets or sets whether to show a ripple effect when the user clicks the button. Default is true.
[Parameter]
[Category("Appearance")]
public bool Ripple { get; set; }
Property Value
Size
The Size of the component.
[Parameter]
[Category("Appearance")]
public Size Size { get; set; }
Property Value
StopClickPropagation
Prevents the parent component from receiving click events.
[Parameter]
[Category("Behavior")]
public bool StopClickPropagation { get; set; }
Property Value
Remarks
Defaults to true
. When true
, the click will not bubble up to parent components.
Value
The currently selected value.
[Parameter]
[Category("Data")]
public T? Value { get; set; }
Property Value
- T
ValueChanged
Occurs when the Value has changed.
[Parameter]
public EventCallback<T?> ValueChanged { get; set; }
Property Value
Methods
ConvertPlacement(Placement)
protected Placement ConvertPlacement(Placement placement)
Parameters
placement
Placement
Returns
GetDisabledState()
protected bool GetDisabledState()
Returns
GetReadOnlyState()
protected bool GetReadOnlyState()
Returns
HasValue(T?)
A value is required, so if not checked we return ERROR.
protected override bool HasValue(T? value)
Parameters
value
T
Returns
OnChange(ChangeEventArgs)
protected virtual Task OnChange(ChangeEventArgs args)
Parameters
args
ChangeEventArgs
Returns
SetBoolValueAsync(bool?, bool?)
protected Task SetBoolValueAsync(bool? value, bool? markAsTouched = null)
Parameters
Returns
SetCheckedAsync(T?)
protected Task SetCheckedAsync(T? value)
Parameters
value
T
Returns
SetConverter(Converter<T?, bool?>)
protected override bool SetConverter(Converter<T?, bool?> value)