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