Button 'PressedForeground' binding error in ContentDialog (4.2.1)
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 9.6k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Version 4.2.1,When open a ContentDialog,cause binding error:
System.Windows.Data Error: 40 : BindingExpression path error: 'PressedForeground' property not found on 'object' ''ContentPresenter' (Name='')'. BindingExpression:Path=PressedForeground; DataItem='ContentPresenter' (Name=''); target element is 'Button' (Name=''); target property is 'Foreground' (type 'Brush')
System.Windows.Data Error: 40 : BindingExpression path error: 'PressedForeground' property not found on 'object' ''UserAddModifyDialog' (Name='')'. BindingExpression:Path=PressedForeground; DataItem='UserAddModifyDialog' (Name=''); target element is 'Button' (Name='CloseButton'); target property is 'Foreground' (type 'Brush')
System.Windows.Data Error: 40 : BindingExpression path error: 'PressedForeground' property not found on 'object' ''ContentDialog' (Name='')'. BindingExpression:Path=PressedForeground; DataItem='ContentDialog' (Name=''); target element is 'Button' (Name='PrimaryButton'); target property is 'Foreground' (type 'Brush')
But version 4.2.0 is OK
To Reproduce
Just create a ContentDialog and press a button in the footer
Expected behavior
No binding errors
Screenshots
No response
OS version
Windows 11 25H2 (26200.8246)
.NET version
.NET 10
WPF-UI NuGet version
4.2.1
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by creating a ContentDialog in WPF-UI 4.2.1 and pressing a footer button, then compare the binding behavior with version 4.2.0. Trace the ContentDialog, ContentPresenter, and button bindings for PressedForeground; the work is done when the reproduction produces no binding errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 57/100