QueryStringThemeService Class

Persist the current theme in the query string. Requires ThemeService to be registered in the DI container.

Inheritance

Object

QueryStringThemeService

Namespace: Radzen

Assembly: Radzen.Blazor.dll

Syntax

public class QueryStringThemeService

Constructors

QueryStringThemeServicelink

Initializes a new instance of the QueryStringThemeService class.

Declaration
public QueryStringThemeService(NavigationManager navigationManager, ThemeService themeService, Microsoft.Extensions.Options.IOptions<QueryStringThemeServiceOptions> options)
Parameters
Type Name Description
NavigationManager navigationManager
ThemeService themeService
Microsoft.Extensions.Options.IOptions<QueryStringThemeServiceOptions> options

Methods

Disposelink

Declaration
public void Dispose()

GetUriWithStateQueryParameterslink

Returns the specified URI with the current theme, WCAG, and right-to-left state appended as query parameters. Use this when building hrefs that must preserve the active theme across navigation - it produces a cleanly URL-encoded query rather than reusing whatever query happens to be on the current URI.

Declaration
public string GetUriWithStateQueryParameters(string uri)
Parameters
Type Name Description
string uri
Returns
Type Description
string
An error has occurred. This app may no longer respond until reloaded. Reload 🗙