lepoco / wpfui

WPF UI provides the Fluent experience in your known and loved WPF framework. Intuitive design, themes, navigation and new immersive controls. All natively and effortlessly.
https://wpfui.lepo.co
MIT License
7.72k stars 756 forks source link

The problem of repeated display of the button in the upper right corner caused by theme switching #1259

Closed Ledgerbiggg closed 4 weeks ago

Ledgerbiggg commented 4 weeks ago

Describe the bug

When the program starts, it is fine, but after switching themes, there is a repetition of the button in the upper right corner

My code is:


public class GlobalSettingsPageModel : BindableBase
{
    private ApplicationTheme _currentApplicationTheme;

    public ApplicationTheme CurrentApplicationTheme
    {
        get => _currentApplicationTheme;
        set
        {

            SetProperty(ref _currentApplicationTheme, value);
            ApplyTheme(value);
        }
    }

    private void ApplyTheme(ApplicationTheme theme)
    {
        ApplicationThemeManager.Apply(theme);
    }

    public GlobalSettingsPageModel()
    {
        CurrentApplicationTheme = ApplicationTheme.Light;
        ApplyTheme(ApplicationTheme.Unknown);
    }
}

To Reproduce

At the beginning image

After switching themes image

Expected behavior

no change

Screenshots

No response

OS version

win11

.NET version

8

WPF-UI NuGet version

WPF-UI 4.0.0

Additional context

No response