Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApplicationAccentColorManager.Apply not applying colour passed #1203

Open
HarryPitsillides opened this issue Aug 16, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@HarryPitsillides
Copy link

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

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

@HarryPitsillides HarryPitsillides added the bug Something isn't working label Aug 16, 2024
@xzmzm
Copy link

xzmzm commented Sep 12, 2024

I've also encountered this issue.
You may try the workaround in #1188 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants