-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
OnPlatform doesn't work with AppThemeBinding on Windows in Release mode. #19388
Comments
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process. |
This issue also occurs on iOS and Android. cc: @jsuarezruiz do you know if this issue is already fixed by a PR? Thanks in advance. |
@vhugogarcia Cheers. Is it possible that the bug is fixed? I ran a sample MAUI app on Mac Catalyst using
and it produced: Screen.Recording.2024-07-23.at.15.24.13.movXAML was as follows: <Label
Text="Hello, World!"
Style="{StaticResource Headline}"
SemanticProperties.HeadingLevel="Level1"
BackgroundColor="{OnPlatform MacCatalyst={AppThemeBinding Light=Blue, Dark=Yellow, Default=White}, Default=Green}"/> and it looks OK to me. I can test on Windows later on. |
Thanks @MartyIX , it is probably fixed, yes 😃 . Could you give us a hand to test it on iOS, Android and Windows as well? please 🙏🏻 |
I can easily test on Windows. Not so much experience with iOS and Android but I guess I can learn some new stuff. |
Sounds good, let us know the results. Thank you! |
@MartyIX The issue was reported on Windows. Not sure there is any value testing on Mac. |
I did that simply because of this comment which sort of suggested that the problem is on all platforms: #19388 (comment) Anyway, on Windows in the release configuration it behaves like this with the latest released version: So it's not fixed. |
Description
Conditionally set the BackgroundColor of the MainPage of a new project using OnPlatform and AppThemeBinding and it will not work in Release mode. Works fine in Debug mode.
BackgroundColor="{OnPlatform WinUI={AppThemeBinding Dark=Yellow, Light=Blue, Default=White}, Default=Green}"
The page renders with a black background (in Dark mode).
Steps to Reproduce
Create new .NET 8.0 MAUI App project in Visual Studio then add the following line to MainPage.xaml inside ContentPage.
BackgroundColor="{OnPlatform WinUI={AppThemeBinding Dark=Yellow, Light=Blue, Default=White}, Default=Green}"
Link to public reproduction project repository
https://github.com/gairmuse/MauiOnPlatformBug
Version with bug
8.0.3
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
7.0.101
Affected platforms
Windows
Affected platform versions
Windows 10.0.19041.0
Did you find any workaround?
Not really. BackgroundColor can be set in code.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: