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

ContentDialog does not follow RequestedTheme properly in XAML Islands #7405

Open
2 tasks
aquinn39 opened this issue Jul 21, 2022 · 4 comments
Open
2 tasks
Labels
area-Dialogs bug Something isn't working product-winui2 team-Controls Issue for the Controls team

Comments

@aquinn39
Copy link

aquinn39 commented Jul 21, 2022

Describe the bug

When a ContentDialog is shown within an XAML Island and it's RequestedTheme does not match the current Windows theme, it does not apply properly (See screenshot below) - mainly the buttons appear to use the wrong RequestedTheme.

Steps to reproduce the bug

  1. Create an app that uses WinUI 2 with XAML Islands (Tutorial here: https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/host-standard-control-with-xaml-islands).
  2. Set Windows' app mode to Dark
  3. Create a ContentDialog with it's requested theme set to Light in XAML and show it.

Expected behavior

The buttons should be in light mode, like the rest of the dialog. This is what happens with the same setup in a UWP app:

image

Screenshots

Here is a ContentDialog in an XAML Island with its RequestedTheme set to Light while the Windows theme is set to dark. Notice that the buttons don't seem to realise they should be in light mode, making the text very hard to read:

image

NuGet package version

Microsoft.UI.Xaml 2.8.0

Windows app type

  • UWP
  • Win32

Device form factor

Desktop

Windows version

Windows 11 (21H2): Build 22000

Additional context

No response

@aquinn39 aquinn39 added the bug Something isn't working label Jul 21, 2022
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Jul 21, 2022
@aquinn39
Copy link
Author

I found some more information about this, it seems the Windows Terminal team has come across this issue as well.
See these for some more details about this problem:

microsoft/terminal#5224
microsoft/terminal#12356
microsoft/terminal#3917
microsoft/terminal#3654
microsoft/terminal#5195

@github-actions
Copy link

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@aquinn39
Copy link
Author

aquinn39 commented Aug 2, 2023

Still happens in the latest version of WinUI 2 and Windows 11.

@zadjii-msft
Copy link
Member

@bpulliam Y'all may want to dedupe with #2331. My limited reading of these two is that they're effectively the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Dialogs bug Something isn't working product-winui2 team-Controls Issue for the Controls team
Projects
None yet
Development

No branches or pull requests

3 participants