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 background does not follow UI theme settings #2331
Comments
The ContentDialog's content are reparented into a popup, which is likely what is causing this. It is disconnected from the parent chain to get any property that is not explicitly routed to the popup content anymore. |
Thanks @ranjeshj . |
will this be ever fixed? I also see this when I use ACR User Dialogs to show progress dialog which is implemented as ContentDialog. |
Did you try settng explicit value? Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> |
where should this be added? I use a nuget package in Xamarin.Forms app and the UWP app has the issue that the progress is white while the rest of the app is dark as I want it to have. |
can't you set it in xaml |
No, I don't use any XAML to call this lib:
And this shows an endless progressdialog which is always white background no matter what RequestedTheme I set |
Found a workaround by setting the
Here's the code in a sample project: https://github.com/lyahdav/CppWinRtUwpSandbox/blob/ContentDialogDarkBug/SharedContent/cppwinrt/MainPage.cpp#L100-L104 And if you want to run it yourself, here's the solution: https://github.com/lyahdav/CppWinRtUwpSandbox/blob/ContentDialogDarkBug/cppwinrt/Calendar.sln |
Summary: This works around a XAML bug: microsoft/microsoft-ui-xaml#2331. Test Plan: See D29628191 Test Plan Reviewers: skyle, ericroz, mylando Reviewed By: ericroz Subscribers: eliwhite Differential Revision: https://phabricator.intern.facebook.com/D29628294 Tasks: T94672218 Signature: 29628294:1626104120:da5e97fc9b4af177a5827ea19703ca0b207d4d46
Currently picker does not support darkMode (at least in our XamlIsland based app). This issues seems to be identical to: microsoft/microsoft-ui-xaml#2331 (and it's fix) See screenshots attached
In my case above workaround works only the first time of content dialog opening, and while showing dialog on next time the content doesn't update with dark theme. Please fix this bug. Due to this we can't go with ContentDialog and need to write our own popup control. |
@karthikraja-arumugam if the workaround only works the first time the content dialog opens, you can just recreate the ContentDialog each time it needs to be opened. For context, you can see that workaround in React Native Windows here after it creates a ContentDialog each time: https://github.com/microsoft/react-native-windows/blob/main/vnext%2FMicrosoft.ReactNative%2FModules%2FAlertModule.cpp#L40 |
@lyahdav - We have the base content dialog in that we have added the editor to open the other content dialog, Due to this framework limitation with muti content dialog popup (#6473 we have intailized the content dialog in theme file to resolve the multi content dialog , we could not initialize every time, is there any other way to resolve? |
@lyahdav as @Jeyasri-Murugan mentioned we can't use popup or any other dialog within ContentDialog, that's why we need to reuse the same dialog instance. |
@Jeyasri-Murugan I'm not really sure then. Perhaps using an event other than ContentDialog.Opened to add the workaround may help, e.g. Loaded event. |
Any news on this issue, it's becoming annoying... |
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. |
Please do not close. Hire some help and fix these issues! |
It seems that the WinUI team won't prioritize this issue since there's a workaround, even though the workaround is quite annoying. Does it mean that we should carefully not integrate the WinUI2/3 library in our future projects without second thought? 😅 |
Any progress on this? |
Describe the bug
Although I have set "RequestedTheme = ElementTheme.Dark" to ContentDialog
But its background part is still white following the system theme
If TeachingTip pops up at this time, ContentDialog will become more white and difficult to recognize
Steps to reproduce the bug
Steps to reproduce the behavior:
Expected behavior
like this
Screenshots
Version Info
NuGet package version:
Additional context
The text was updated successfully, but these errors were encountered: