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.43k stars 720 forks source link

ApplicationAccentColorManager.Apply not applying colour passed #1203

Open HarryPitsillides opened 1 month ago

HarryPitsillides commented 1 month ago

Describe the bug

When using ApplicationAccentColorManager it seems it does not use the colour passed to it.

To Reproduce

 public MainWindow()
    {
        ApplicationAccentColorManager.Apply(
            Color.FromRgb(25, 97, 55), // Green
            ApplicationTheme.Light,
            false
        );

        InitializeComponent();

    }
<Window x:Class="WpfApp1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp1"
        xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">

    <Window.Resources>
        <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ui:ThemesDictionary Theme="Light" />
                    <ui:ControlsDictionary />
                </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <StackPanel>
        <CheckBox Content="Hello"></CheckBox>
        <ui:Button Appearance="Primary" Content="Hello WPF!"></ui:Button>
    </StackPanel>
</Window>

Checkbox when clicked is light blue, button even though set to primary is light blue, i would expect both to be green

Expected behavior

I would expect both the checkbox and the button to have the green colour i passed to the manager

Screenshots

image image

OS version

Windows 11

.NET version

.Net 4.8.1, .Net Core 8

WPF-UI NuGet version

3.0.5, 3.0.4

Additional context

No response

xzmzm commented 1 week ago

I've also encountered this issue. You may try the workaround in https://github.com/lepoco/wpfui/issues/1188#issue-2444629509.