This example demonstrates how to create a Theme Switcher as in DevExpress Blazor Demos and apply the selected theme to an application dynamically. The example contains solutions both for server-side and client-side Blazor.
This Theme Switcher offers the standard Bootstrap theme, 2 DevExpress Bootstrap themes, and 21 Bootstwatch themes.
Files to look at:
| Server-Side Blazor | Client-Side Blazor |
|---|---|
| ThemeSwitcher.razor | ThemeSwitcher.razor
| MainLayout.razor | MainLayout.razor
| Index.razor | Index.razor
| site.css | site.css
| switcher-resources (folder) | switcher-resources (folder)
| ThemeLink.razor |
| LinkService.cs
| Startup.cs |
| _Host.cshtml |