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, 3 DevExpress Bootstrap themes, and 21 Bootstwatch themes.
Refer to the Themes documentation topic for more information.
Files to look at:
Server-Side Blazor
- ThemeSwitcher.razor
- MainLayout.razor
- Index.razor
- site.css
- switcher-resources (folder)
- ThemeLink.razor
- LinkService.cs
- Startup.cs
- _Host.cshtml
Client-Side Blazor