wpfui
wpfui copied to clipboard
ApplicationAccentColorManager.Apply not applying colour passed
Describe the bug
When using ApplicationAccentColorManager it seems it does not use the colour passed to it.
To Reproduce
- Create a brand new WPF application
- In MainWindow.xaml.cs
public MainWindow()
{
ApplicationAccentColorManager.Apply(
Color.FromRgb(25, 97, 55), // Green
ApplicationTheme.Light,
false
);
InitializeComponent();
}
- In MainWindow.xaml
<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
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
I've also encountered this issue. You may try the workaround in https://github.com/lepoco/wpfui/issues/1188#issue-2444629509.