Skip to content

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

Merged
pomianowski merged 2 commits into
lepoco:mainfrom
dkuaf:bug/1699-buttonRegression
May 4, 2026
Merged

pomianowski merged 2 commits into
lepoco:mainfrom
dkuaf:bug/1699-buttonRegression

Conversation

@dkuaf

@dkuaf dkuaf commented May 1, 2026

Copy link
Copy Markdown
Contributor

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
@pomianowski pomianowski self-assigned this May 4, 2026
@pomianowski
pomianowski merged commit 69b28a2 into lepoco:main May 4, 2026
2 checks passed
axiomoth pushed a commit to splrad/LayerScape that referenced this pull request Jul 9, 2026
)

Updated [System.Management](https://github.com/dotnet/dotnet) from
10.0.7 to 10.0.9.

<details>
<summary>Release notes</summary>

_Sourced from [System.Management's
releases](https://github.com/dotnet/dotnet/releases)._

No release notes found for this version range.

Commits viewable in [compare
view](https://github.com/dotnet/dotnet/commits).
</details>

Updated
[System.ValueTuple](https://github.com/dotnet/maintenance-packages) from
4.5.0 to 4.6.2.

<details>
<summary>Release notes</summary>

_Sourced from [System.ValueTuple's
releases](https://github.com/dotnet/maintenance-packages/releases)._

No release notes found for this version range.

Commits viewable in [compare
view](https://github.com/dotnet/maintenance-packages/commits).
</details>

Updated [WPF-UI](https://github.com/lepoco/wpfui) from 4.2.1 to 4.3.0.

<details>
<summary>Release notes</summary>

_Sourced from [WPF-UI's
releases](https://github.com/lepoco/wpfui/releases)._

## 4.3.0

## What's Changed
* fix(controls): Add UpdateAutoSuggestBoxSuggestions call on
MenuItemCollection change by @​scanfing in
lepoco/wpfui#1696
* fix(tray): support Unicode for NotifyIcon.TooltipText by @​chucker in
lepoco/wpfui#1706
* feat(controls): Implement `SpinButtonPlacementMode.Compact` for
`NumberBox` by @​chucker in lepoco/wpfui#1709
* fix(controls): Change order of triggers for Button by @​dkuaf in
lepoco/wpfui#1702


**Full Changelog**:
lepoco/wpfui@4.2.1...4.3.0

Commits viewable in [compare
view](lepoco/wpfui@4.2.1...4.3.0).
</details>

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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

2 participants