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

Windows Accent Color Coming Through #45

Open
under3415 opened this issue Aug 14, 2020 · 1 comment
Open

Windows Accent Color Coming Through #45

under3415 opened this issue Aug 14, 2020 · 1 comment

Comments

@under3415
Copy link

under3415 commented Aug 14, 2020

If I change the Windows 10 accent color, I can see this color (lime) come through instead of the in-app selected accent color (blue) in some cases (e.g. mouse hover over check box). See image.

accentColor

Interestingly, this happens for mouse hover in both Light and Dark themes for check boxes, radio buttons and slider controls, but only in Dark theme for toggle switch control.

@under3415
Copy link
Author

under3415 commented Aug 29, 2020

Found that in my app this had to do with merging resources.

When I had this in app.xaml (for WinUI controls)

    <Application.Resources>
                            <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
    </Application.Resources>

and this in Page resources

<Page.Resources>
           <ResourceDictionary>
               <ResourceDictionary.MergedDictionaries>
                   <ResourceDictionary Source="ThemeDictionary.xaml"/>
               </ResourceDictionary.MergedDictionaries>
           </ResourceDictionary>
   </Page.Resources>

I was getting all sort of color weirdness. Sometimes theme colors would be used and in other cases the Windows OS colors would be used.

When I put both in app.xaml, that fixed the issue. Not sure why you still have it in your app, maybe check merging?

  <Application.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
                    <ResourceDictionary Source="ThemeDictionary.xaml"/>
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
    </Application.Resources>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant