RadzenAppearanceToggle Class

Dark or light theme switch. Requires ThemeService to be registered in the DI container.

Inheritance

Object

ComponentBase

RadzenComponent

RadzenAppearanceToggle

Implements

IComponent

IHandleEvent

IHandleAfterRender

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenAppearanceToggle : RadzenComponent, IComponent, IHandleEvent, IHandleAfterRender

Constructors

RadzenAppearanceTogglelink

Dark or light theme switch. Requires ThemeService to be registered in the DI container.

Declaration
public RadzenAppearanceToggle()

Properties

ButtonStylelink

Gets or sets the switch button style.

Declaration
public ButtonStyle ButtonStyle { get; set; }
Property Value
Type Description
ButtonStyleGets or sets the switch button style.

DarkThemelink

Gets or sets the dark theme. Not set by default - the component uses the dark version of the current theme.

Declaration
public string DarkTheme { get; set; }
Property Value
Type Description
stringGets or sets the dark theme. Not set by default - the component uses the dark version of the current theme.

LightThemelink

Gets or sets the light theme. Not set by default - the component uses the light version of the current theme.

Declaration
public string LightTheme { get; set; }
Property Value
Type Description
stringGets or sets the light theme. Not set by default - the component uses the light version of the current theme.

ToggleButtonStylelink

Gets or sets the switch button toggled style.

Declaration
public ButtonStyle ToggleButtonStyle { get; set; }
Property Value
Type Description
ButtonStyleGets or sets the switch button toggled style.

ToggleShadelink

Gets or sets the switch button toggled shade.

Declaration
public Shade ToggleShade { get; set; }
Property Value
Type Description
ShadeGets or sets the switch button toggled shade.

Variantlink

Gets or sets the switch button variant.

Declaration
public Variant Variant { get; set; }
Property Value
Type Description
VariantGets or sets the switch button variant.

Methods

BuildRenderTreelink

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

Disposelink

Declaration
public override void Dispose()

OnInitializedlink

Declaration
protected override void OnInitialized()
An error has occurred. This app may no longer respond until reloaded. Reload 🗙