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

When changing the application theme using RequestedTheme, the colors of the toolbar buttons in the TitleBar do not change properly. #9722

Open
LexeyLex opened this issue Jun 12, 2024 · 1 comment
Labels
area-TitleBar Issues related to custom window title bars. bug Something isn't working feature proposal New feature proposal team-CompInput Issue for IXP (Composition, Input) team

Comments

@LexeyLex
Copy link

Describe the bug

When I change the application theme to another in code, the buttons in the toolbar (Close, Collapse, Maximize) remain with the style of the previous theme.

Steps to reproduce the bug

  1. Create new Empty WinUI app
  2. Add theme change code: ((FrameworkElement)Content.XamlRoot.Content).RequestedTheme = ElementTheme.Light;
  3. Start the app
  4. See how the colors of the buttons in the toolbar do not change properly, but remain the color of the previous theme

Expected behavior

Toolbar button colors should change appropriately to match the theme of the entire program

Screenshots

image
image

NuGet package version

WinUI 3 - Windows App SDK 1.5.4: 1.5.240607001

Windows version

Windows 11 (22H2): Build 22621

Additional context

All other colors change perfectly

@LexeyLex LexeyLex added the bug Something isn't working label Jun 12, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Jun 12, 2024
@codendone codendone added team-CompInput Issue for IXP (Composition, Input) team area-TitleBar Issues related to custom window title bars. and removed needs-triage Issue needs to be triaged by the area owners labels Jun 20, 2024
@ranjeshj
Copy link
Contributor

ranjeshj commented Jun 21, 2024

Application.RequestedTheme needs to handle this scenario. WinUIGallery works around this issue (not ideal) but you can see how it is done there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-TitleBar Issues related to custom window title bars. bug Something isn't working feature proposal New feature proposal team-CompInput Issue for IXP (Composition, Input) team
Projects
None yet
Development

No branches or pull requests

3 participants