# QueryStringThemeService Class

Persist the current theme in the query string. Requires [ThemeService](https://blazor.radzen.com/docs/api/Radzen.ThemeService.md) to be registered in the DI container.

Namespace: [Radzen](https://blazor.radzen.com/docs/api/Radzen.md)

Assembly: Radzen.Blazor.dll

## Inheritance

- Object
- QueryStringThemeService

## Syntax

```csharp
public class QueryStringThemeService
```

## Constructors

| Constructor | Description |
|-------------|-------------|
| `public QueryStringThemeService(NavigationManager navigationManager, ThemeService themeService, Microsoft.Extensions.Options.IOptions<QueryStringThemeServiceOptions> options)` | Initializes a new instance of the [QueryStringThemeService](https://blazor.radzen.com/docs/api/Radzen.QueryStringThemeService.md) class. |

## Methods

| Method | Returns | Description |
|------|---------|-------------|
| `Dispose()` | `void` |  |
| `GetUriWithStateQueryParameters(string uri)` | `string` | 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. |

