Skip to content

Button 'PressedForeground' binding error in ContentDialog (4.2.1) #1694

@Mili-Kano

Description

@Mili-Kano

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions