Skip to content

[regression/9.0] VisualState "Disabled" is not properly applied for Button with custom appearance #34363

@janusw

Description

@janusw

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

  1. Build and run the linked repro project.
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions