This repository contains a sample Blazor WebAssembly application demonstrating how to switch themes dynamically in a .NET 10 Blazor app using a shared layout, a Syncfusion theme selector, and runtime stylesheet updates.
- Dynamic Theme Switching: Updates the active Blazor theme without reloading the app
- Built-in Theme Selection: Provides a DropDownList with light, dark, and high-contrast theme options
- Shared Layout Experience: Keeps the theme switcher available across all pages
- Runtime Style Loading: Uses a JavaScript helper to swap the theme stylesheet on demand
- Blazor Routing and Interactivity: Includes sample pages for navigation and basic component behavior
- .NET 10 SDK
- Visual Studio Code with the C# Dev Kit extension
- A supported browser such as Microsoft Edge, Google Chrome, Firefox, or Safari
-
Open the project folder in Visual Studio Code.
-
Install the recommended extensions if prompted.
-
Open the integrated terminal (
Ctrl + ~). -
Restore NuGet packages:
dotnet restore
-
Build the project:
dotnet build
-
Run the application:
dotnet run
-
Open the URL shown in the terminal. The local port may vary depending on your environment and launch profile.