Application-wide light and dark state

Theme Variant Switching

Change application appearance through one small runtime operation.

Explore source
Parent systemThemeManager.Avalonia
StatusMaintained
Modules1
RepositoryThemeManager.Avalonia/ThemeManager

Both managers translate a compact numeric selection into Application.RequestedThemeVariant, switching the entire application between Avalonia light and dark variants at runtime.

  1. 01

    Application.RequestedThemeVariant integration

  2. 02

    Light and dark selection

  3. 03

    Same behavior for Fluent and Simple

  4. 04

    No per-window theme plumbing

From intent
to working system.

01

Select

The application maps a setting or command to the supported index.

02

Switch

The manager resolves light or dark ThemeVariant.

03

Request

Application.RequestedThemeVariant changes once for the app.

04

Propagate

Avalonia updates resources and controls throughout the visual tree.

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.

01 · Install
Terminal
dotnet add package ThemeManager
02 · Use · csharp
QuickStart.cs
IThemeManager themes = new FluentThemeManager();
themes.Initialize(Application.Current!);
themes.Switch(0); // ThemeVariant.Light
themes.Switch(1); // ThemeVariant.Dark

Use one layer.
Compose the rest.

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.

ThemeManager.Avalonia

Search everything.

Loading the index…

move open esc close

Preparing metadata and full-text search…