Class MudSwitch<T>
- Namespace
- MudBlazor
- Assembly
- MudBlazor.dll
public class MudSwitch<T> : MudBooleanInput<T>, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged, IFormComponent, IDisposable
Type Parameters
T
- Inheritance
-
MudFormComponent<T, bool?>MudSwitch<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
MudSwitch()
public MudSwitch()
Properties
ChildContent
[Parameter]
[Category("Behavior")]
public RenderFragment? ChildContent { get; set; }
Property Value
Classname
protected string Classname { get; }
Property Value
Color
The color of the component. It supports the theme colors.
[Parameter]
[Category("Appearance")]
public Color Color { get; set; }
Property Value
Label
The text/label will be displayed next to the switch if set.
[Parameter]
[Category("Behavior")]
public string? Label { get; set; }
Property Value
LabelClassname
protected string LabelClassname { get; }
Property Value
LabelPosition
The position of the text/label.
[Parameter]
[Category("Behavior")]
public LabelPosition LabelPosition { 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 switch.
[Parameter]
[Category("Appearance")]
public Size Size { get; set; }
Property Value
SpanClassname
protected string SpanClassname { get; }
Property Value
SwitchClassname
protected string SwitchClassname { get; }
Property Value
SwitchLabelClassname
protected string SwitchLabelClassname { get; }
Property Value
ThumbClassname
protected string ThumbClassname { get; }
Property Value
ThumbIcon
Shows an icon on Switch's thumb.
[Parameter]
[Category("Appearance")]
public string? ThumbIcon { get; set; }
Property Value
ThumbIconColor
The color of the thumb icon. Supports the theme colors.
[Parameter]
[Category("Appearance")]
public Color ThumbIconColor { get; set; }
Property Value
TrackClassname
protected string TrackClassname { get; }
Property Value
UncheckedColor
The base color of the component in its none active/unchecked state. It supports the theme colors.
[Parameter]
[Category("Appearance")]
public Color UncheckedColor { get; set; }
Property Value
Methods
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
Dispose(bool)
protected override void Dispose(bool disposing)
Parameters
disposing
bool
HandleKeyDown(KeyboardEventArgs)
protected void HandleKeyDown(KeyboardEventArgs obj)
Parameters
OnAfterRenderAsync(bool)
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
firstRender
bool
Returns
OnInitialized()
protected override void OnInitialized()