Closed gairmuse closed 2 days ago
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
dotnet build -t:run -c Release --framework net8.0-maccatalyst
and it produced:
https://github.com/user-attachments/assets/a6e520e5-2047-436e-92cf-cf283106c836
XAML 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.
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.
@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: https://github.com/dotnet/maui/issues/19388#issuecomment-2061489154
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