Class ThemeService
Service for theme registration and management.
Inherited Members
Namespace: Radzen
Assembly: Radzen.Blazor.dll
Syntax
public class ThemeService
Constructors
ThemeService(IJSRuntime, IServiceProvider)
Service for theme registration and management.
Declaration
public ThemeService(IJSRuntime jsRuntime, IServiceProvider serviceProvider)
Parameters
| Type | Name | Description |
|---|---|---|
| IJSRuntime | jsRuntime | |
| IServiceProvider | serviceProvider |
Properties
RightToLeft
Specify if the theme should be right-to-left.
Declaration
public bool? RightToLeft { get; }
Property Value
| Type | Description |
|---|---|
| bool? |
Theme
Gets the current theme.
Declaration
public string Theme { get; }
Property Value
| Type | Description |
|---|---|
| string |
Wcag
Specify if the theme colors should meet WCAG contrast requirements.
Declaration
public bool? Wcag { get; }
Property Value
| Type | Description |
|---|---|
| bool? |
Methods
SetRightToLeft(bool)
Specifies if the theme should be right-to-left.
Declaration
public void SetRightToLeft(bool rightToLeft)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | rightToLeft |
SetTheme(ThemeOptions)
Changes the current theme with additional options.
Declaration
public void SetTheme(ThemeOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| ThemeOptions | options |
SetTheme(string, bool)
Changes the current theme.
Declaration
public void SetTheme(string theme, bool triggerChange = true)
Parameters
| Type | Name | Description |
|---|---|---|
| string | theme | |
| bool | triggerChange |
SetWcag(bool)
Enables or disables WCAG contrast requirements.
Declaration
public void SetWcag(bool wcag)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | wcag |
Events
ThemeChanged
Raised when the theme changes.
Declaration
public event Action ThemeChanged
Event Type
| Type | Description |
|---|---|
| Action |