Table of Contents

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
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

RenderFragment

Classname

protected virtual string? Classname { get; set; }

Property Value

string

Color

The color of the component. It supports the theme colors.

[Parameter]
[Category("Appearance")]
public Color Color { get; set; }

Property Value

Color

Disabled

Prevents the user from interacting with this input.

[Parameter]
[Category("Behavior")]
public bool Disabled { get; set; }

Property Value

bool

Remarks

Defaults to false.

IconClassname

protected virtual string? IconClassname { get; set; }

Property Value

string

Label

The text/label will be displayed next to the switch if set.

[Parameter]
[Category("Appearance")]
public string? Label { get; set; }

Property Value

string

LabelClassname

protected virtual string? LabelClassname { get; set; }

Property Value

string

LabelPlacement

The location of the label relative to the input icon.

[Parameter]
[Category("Appearance")]
public Placement LabelPlacement { get; set; }

Property Value

Placement

ReadOnly

Prevents the user from changing the input.

[Parameter]
[Category("Behavior")]
public bool ReadOnly { get; set; }

Property Value

bool

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

bool

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

bool

Size

The Size of the component.

[Parameter]
[Category("Appearance")]
public Size Size { get; set; }

Property Value

Size

StopClickPropagation

Prevents the parent component from receiving click events.

[Parameter]
[Category("Behavior")]
public bool StopClickPropagation { get; set; }

Property Value

bool

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

EventCallback<T>

Methods

ConvertPlacement(Placement)

protected Placement ConvertPlacement(Placement placement)

Parameters

placement Placement

Returns

Placement

GetDisabledState()

protected bool GetDisabledState()

Returns

bool

GetReadOnlyState()

protected bool GetReadOnlyState()

Returns

bool

HasValue(T?)

A value is required, so if not checked we return ERROR.

protected override bool HasValue(T? value)

Parameters

value T

Returns

bool

OnChange(ChangeEventArgs)

protected virtual Task OnChange(ChangeEventArgs args)

Parameters

args ChangeEventArgs

Returns

Task

SetBoolValueAsync(bool?, bool?)

protected Task SetBoolValueAsync(bool? value, bool? markAsTouched = null)

Parameters

value bool?
markAsTouched bool?

Returns

Task

SetCheckedAsync(T?)

protected Task SetCheckedAsync(T? value)

Parameters

value T

Returns

Task

SetConverter(Converter<T?, bool?>)

protected override bool SetConverter(Converter<T?, bool?> value)

Parameters

value Converter<T, bool?>

Returns

bool