Application-wide light and dark state
Theme Variant Switching
Change application appearance through one small runtime operation.
Explore source ↗Capability
Both managers translate a compact numeric selection into Application.RequestedThemeVariant, switching the entire application between Avalonia light and dark variants at runtime.
- 01
Application.RequestedThemeVariant integration
- 02
Light and dark selection
- 03
Same behavior for Fluent and Simple
- 04
No per-window theme plumbing
How it composes
From intent
to working system.
Select
The application maps a setting or command to the supported index.
Switch
The manager resolves light or dark ThemeVariant.
Request
Application.RequestedThemeVariant changes once for the app.
Propagate
Avalonia updates resources and controls throughout the visual tree.
Quick start
Adopt this
capability.
Start with the primary module, then add the related packages only when the application needs those layers. Replace VERSION with the current NuGet version.
dotnet add package ThemeManager<PackageReference Include="ThemeManager" Version="VERSION" /><PackageVersion Include="ThemeManager" Version="VERSION" />IThemeManager themes = new FluentThemeManager();themes.Initialize(Application.Current!);
themes.Switch(0); // ThemeVariant.Lightthemes.Switch(1); // ThemeVariant.DarkModules in this capability
Use one layer.
Compose the rest.
Source of truth
Read the module beside the complete system.
The implementation, samples, issues, and release notes stay in the parent repository so module details remain connected to the product architecture.