Table of Contents

Class MudToggleItem<T>

Namespace
MudBlazor
Assembly
MudBlazor.dll
public class MudToggleItem<T> : MudComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IMudStateHasChanged

Type Parameters

T
Inheritance
MudToggleItem<T>
Implements
Inherited Members
Extension Methods

Constructors

MudToggleItem()

public MudToggleItem()

Properties

CheckMarkClassname

protected string CheckMarkClassname { get; }

Property Value

string

ChildContent

Custom child content which overrides the text. The boolean parameter conveys whether or not the item is selected.

[Parameter]
[Category("Appearance")]
public RenderFragment<bool>? ChildContent { get; set; }

Property Value

RenderFragment<bool>

Classname

protected string Classname { get; }

Property Value

string

Disabled

If true, the item will be disabled.

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

Property Value

bool

IsEmpty

protected bool IsEmpty { get; }

Property Value

bool

Parent

[CascadingParameter]
public MudToggleGroup<T>? Parent { get; set; }

Property Value

MudToggleGroup<T>

Selected

protected bool Selected { get; }

Property Value

bool

SelectedIcon

Icon to show if the item is selected (if CheckMark is true on the parent group) By default this is set to a check mark icon.

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

Property Value

string

Text

The text to show. You need to set this only if you want a text that differs from the Value. If null, show Value?.ToString(). Note: the Text is only shown if you haven't defined your own child content.

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

Property Value

string

TextClassname

protected string TextClassname { get; }

Property Value

string

UnselectedIcon

Icon to show if the item is not selected (if CheckMark is true on the parent group) Leave null to show no check mark (default).

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

Property Value

string

Value

[Parameter]
[Category("Behavior")]
public T? Value { get; set; }

Property Value

T

Methods

BuildRenderTree(RenderTreeBuilder)

protected override void BuildRenderTree(RenderTreeBuilder __builder)

Parameters

__builder RenderTreeBuilder

GetDisabledState()

protected bool GetDisabledState()

Returns

bool

HandleOnClickAsync()

protected Task HandleOnClickAsync()

Returns

Task

OnInitialized()

protected override void OnInitialized()

SetSelected(bool)

public void SetSelected(bool selected)

Parameters

selected bool