Skip to content

fix(controls): Change order of triggers for Button#1702

Open
dkuaf wants to merge 1 commit intolepoco:mainfrom
dkuaf:bug/1699-buttonRegression
Open

fix(controls): Change order of triggers for Button#1702
dkuaf wants to merge 1 commit intolepoco:mainfrom
dkuaf:bug/1699-buttonRegression

Conversation

@dkuaf
Copy link
Copy Markdown
Contributor

@dkuaf dkuaf commented May 1, 2026

Since 4.2.1, a ui:Button with Appearance="Primary" IsEnabled="False" renders white text on the grey disabled background — invisible in light theme.

Pull request type

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

WPF Style triggers have higher precedence than ControlTemplate triggers for the same dependency property. The Appearance="Primary" Style trigger sets Foreground = AccentButtonForeground (white). When the button is also disabled, the ControlTemplate's IsEnabled=False trigger attempts to set Foreground = ButtonForegroundDisabled, but is overridden by the Style-level Appearance trigger — leaving white text on a grey disabled background.

Issue Number: #1699
fixes #1699

What is the new behavior?

moved Appearance-specific settings to inside the ControlTemplate.Triggers and positioned them first in the trigger list

Other information

Added section in gallery as per example in issue #1699

@dkuaf dkuaf requested a review from pomianowski as a code owner May 1, 2026 16:17
@github-actions github-actions Bot added controls Changes to the appearance or logic of custom controls. styles Topic is related to styles PR Pull request gallery WPF UI Gallery release labels May 1, 2026
@dkuaf dkuaf changed the title (fix): Change order of triggers for Button fix(controls): Change order of triggers for Button May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

controls Changes to the appearance or logic of custom controls. gallery WPF UI Gallery PR Pull request release styles Topic is related to styles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disabled Appearance="Primary" button renders white text on light background (invisible) since 4.2.1

1 participant