Add theme selection dropdown and refactor theme handling

Introduce a DxComboBox in MainLayout for selecting between multiple themes. Update ThemeState to manage the current theme, provide a list of available themes, and apply the selected theme via a new SetTheme method. Refactor dark mode handling to work with the new theme system, and ensure UI updates on theme or mode changes.
This commit is contained in:
OlgunR
2026-04-23 15:44:26 +02:00
parent 292ce02370
commit 35e39ff979
2 changed files with 43 additions and 16 deletions

View File

@@ -9,7 +9,12 @@
<main>
<div class="top-row px-4">
<DxButton Text="@(ThemeState.IsDarkMode ? "Dark Mode aus" : "Dark Mode an")" Click="ToggleTheme" />
<DxComboBox Data="@ThemeState.AvailableThemes"
Value="@ThemeState.CurrentThemeName"
ValueChanged="@((string t) => ThemeState.SetTheme(t))"
style="width: 130px;" />
<DxButton Text="@(ThemeState.IsDarkMode ? "Dark Mode aus" : "Dark Mode an")"
Click="ToggleTheme" />
<a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a>
</div>