Skip to content

Theme switching doesn't work properly #1193

@JellyBelly1809

Description

@JellyBelly1809

Describe the bug

Hello, I am trying to implement a dark theme into my application, but trying to switch themes causes some weird behavior (see clip).

Page.cs:

private async void OnLightThemeRadioButtonChecked(object sender, RoutedEventArgs e)
{
    Wpf.Ui.Appearance.ApplicationThemeManager.Apply(Wpf.Ui.Appearance.ApplicationTheme.Light);
}

private async void OnDarkThemeRadioButtonChecked(object sender, RoutedEventArgs e)
{
    Wpf.Ui.Appearance.ApplicationThemeManager.Apply(Wpf.Ui.Appearance.ApplicationTheme.Dark);
}

MainWindow.cs:

public MainWindow()
{
    Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this);
    InitializeComponent();
}

To Reproduce

Switch themes with Wpf.Ui.Appearance.ApplicationThemeManager.Apply()

Expected behavior

I would expect the themes to simply switch like in the demo app.

Screenshots

clip.mp4

OS version

Windows 11 23H2 (Build 22631.3958)

.NET version

.Net 8.0

WPF-UI NuGet version

3.0.5

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions