Description
With .NET/MAUI 9.x and 10.x, a Button with a custom appearance (BackgroundColor & TextColor) is not properly displayed in the "Disabled" VisualState from Styles.xaml when setting IsEnabled=false.
This used to work well with MAUI 8.x (up to 8.0.100), as demonstrated by the branch dotnet8 in the repro repo. It is broken with MAUI 9.x and 10.x, starting with version 9.0.0 (see branches dotnet9 and dotnet10 = main). It also works when removing the custom BackgroundColor and TextColor.
Steps to Reproduce
- Build and run the linked repro project.
- Toggle the checkbox (possibly mutliple times).
Expected outcome: The Button is displayed in disabled state when the CheckBox is unchecked.
Acutal outcome: The Button always looks the same.
Link to public reproduction project repository
https://github.com/janusw/MauiBugRepro
Version with bug
9.0.0 GA
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
.NET 8 (Please specify exact version)
Affected platforms
Android, iOS, macOS, I was not able test on other platforms
Affected platform versions
Android 16, iOS 26, MacOS 26
Did you find any workaround?
No response
Relevant log output
Description
With .NET/MAUI 9.x and 10.x, a
Buttonwith a custom appearance (BackgroundColor & TextColor) is not properly displayed in the "Disabled" VisualState fromStyles.xamlwhen settingIsEnabled=false.This used to work well with MAUI 8.x (up to 8.0.100), as demonstrated by the branch
dotnet8in the repro repo. It is broken with MAUI 9.x and 10.x, starting with version 9.0.0 (see branchesdotnet9anddotnet10=main). It also works when removing the customBackgroundColorandTextColor.Steps to Reproduce
Expected outcome: The Button is displayed in disabled state when the CheckBox is unchecked.
Acutal outcome: The Button always looks the same.
Link to public reproduction project repository
https://github.com/janusw/MauiBugRepro
Version with bug
9.0.0 GA
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
.NET 8 (Please specify exact version)
Affected platforms
Android, iOS, macOS, I was not able test on other platforms
Affected platform versions
Android 16, iOS 26, MacOS 26
Did you find any workaround?
No response
Relevant log output