ThemeService Class

Service for theme registration and management.

Inheritance

Object

ThemeService

Namespace: Radzen

Assembly: Radzen.Blazor.dll

Syntax

public class ThemeService

Constructors

ThemeServicelink

Service for theme registration and management.

Declaration
public ThemeService(Microsoft.JSInterop.IJSRuntime jsRuntime, IServiceProvider serviceProvider)
Parameters
Type Name Description
Microsoft.JSInterop.IJSRuntime jsRuntime
IServiceProvider serviceProvider

Properties

RightToLeftlink

Specify if the theme should be right-to-left.

Declaration
public bool? RightToLeft { get; }
Property Value
Type Description
bool?Specify if the theme should be right-to-left.

Themelink

Gets the current theme.

Declaration
public string Theme { get; }
Property Value
Type Description
stringGets the current theme.

Wcaglink

Specify if the theme colors should meet WCAG contrast requirements.

Declaration
public bool? Wcag { get; }
Property Value
Type Description
bool?Specify if the theme colors should meet WCAG contrast requirements.

Methods

SetRightToLeftlink

Specifies if the theme should be right-to-left.

Declaration
public void SetRightToLeft(bool rightToLeft)
Parameters
Type Name Description
bool rightToLeft

SetThemelink

Changes the current theme.

Declaration
public void SetTheme(string theme, bool triggerChange)
Parameters
Type Name Description
string theme
bool triggerChange

SetThemelink

Changes the current theme.

Declaration
public void SetTheme(ThemeOptions options)
Parameters
Type Name Description
ThemeOptions options

SetWcaglink

Enables or disables WCAG contrast requirements.

Declaration
public void SetWcag(bool wcag)
Parameters
Type Name Description
bool wcag

Events

ThemeChangedlink

Raised when the theme changes.

Declaration
public event Action ThemeChanged
An error has occurred. This app may no longer respond until reloaded. Reload 🗙