Open usausa opened 1 year ago
Seems to be relevant to my issue. I figured out, it depends if you set the VisualStyleGroups
in a Style
with a key or not.
https://github.com/dotnet/maui/issues/16569
not a dupe of #16569, sorry
@StephaneDelcroix did this happen with the .NET 8 or main, or just in .NET 7?
We do have this issue as well that was fixed recently: https://github.com/dotnet/maui/issues/11662 This was fixed in .NET 8: https://github.com/dotnet/maui/pull/13836
There are 2 workarounds for .NET 7:
Use Background
instead of the older BackgroundColor
Remap the BackgroundColor to Background mapper:
.ConfigureMauiHandlers(_ =>
{
LabelHandler.Mapper.AppendToMapping(
nameof(View.BackgroundColor),
(handler, View) => handler.UpdateValue(nameof(IView.Background)));
ButtonHandler.Mapper.AppendToMapping(
nameof(View.BackgroundColor),
(handler, View) => handler.UpdateValue(nameof(IView.Background)));
})
Verified this on Visual Studio Enterprise 17.8.0 Preview 1.0 with below project:
This issue repro on Release mode of Android 13.0-API33 .NET 7, does not repro on Release mode on Windows. This issue does not repro on Release mode of Android 13.0-API33 .NET 8, and Release mode on Windows.
Release mode of Android .NET 8:
Description
A sample source for switching the Disabled state of a button is shown below. When a button is clicked to switch states, VisualStateManager is not updated to the content of the VisualState of Disabled for the button that exists in Style.
Image
Conditions for reproducing the problem
Steps to Reproduce
Link to public reproduction project repository
https://github.com/usausa/Issue-MAUI-ButtonState
Version with bug
7.0.49
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android (all)
Did you find any workaround?
No response
Relevant log output
No response