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

SetAppThemeColor for Label or Entry background colours only works on initial state on release builds #16430

Closed
JohnHDev opened this issue Jul 29, 2023 · 2 comments
Labels

Comments

@JohnHDev
Copy link

Description

On release builds only:
When using SetAppThemeColor on label or entry background colours, when a page loads it takes the current app theme correctly. However toggling to light or dark doesn't update it.
This works correctly in debug builds

Steps to Reproduce

Create a page with a label, set the label background binding like so:
label.SetAppThemeColor(VisualElement.BackgroundColorProperty, Colors.Red, Colors.Blue);

Run the app in release, see the label has the correct background colour.
Toggle the device theme (light to dark for example)
Label and entry backgrounds don't update, but other controls do.

Link to public reproduction project repository

nope

Version with bug

Unknown/Other

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 16

Did you find any workaround?

No.
The version with bug options is out of date, it is 7.0.92, the current production version of .NET MAUI.

Relevant log output

No response

@JohnHDev JohnHDev added the t/bug Something isn't working label Jul 29, 2023
@Dokug
Copy link

Dokug commented Jul 29, 2023

I guess this is the same error as in #16250 and #11662 and should be fixed by #13836 while the workaround currently is to use the BackgroundProperty instead of the BackgroundColorProperty.

At least that was what worked for me and some others as well, I think

@JohnHDev
Copy link
Author

@Dokug you are correct as the workaround mentioned in those tickets works for both Label and Entry backgrounds, so will close this ticket. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Aug 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants