maui
maui copied to clipboard
Fix Switch Off Track Color - Fixes #10099
Fixes: https://github.com/dotnet/maui/issues/10099
The customer points out that when a switch track color is set, the switch is turned on, then when the switch is turned off, the switch track color stays on which is not the expected behavior. See below:
Original Incorrect Behavior
Adjusted Behavior
After the fix from this PR, the switch works as expected:
Customer reported issues in both android and iOS when using the VisualStateManager, but android worked fine for me without any fixes as shown above
Needs tests 😋
I added the NRE checks fine, but the tests that I added started failing again locally for other reasons. I am looking into it some more, but it seems that the UIView that I get into my test is different (different handle at least) and the colors that were set are not set for the argument passed into my test. Visually, things work as expected though..
/azp run
Azure Pipelines successfully started running 2 pipeline(s).
Thank you for your pull request. We are auto-formatting your source code to follow our code guidelines.
@PureWeen @mattleibow @mandel-macaque This one should be good now!
@tj-devel709 would love a backport to .NET 7
Some people requested a backport to net7.
This is functionality that works in Xamarin.Forms and the change seems safe enough. On the other hand, a workaround is available and we're close to .NET 8 where this is already fixed.