Skip to content

CoerceValueCallback call after source updated causes source got a wrong value #11776

Description

@ahdung

Description

I'm writting a NumericUpDown control, when user click up/down button, the Value will increase or decrease, but limit by MaxValue/MinValue in CoerceValueCallback, when Value and MinValue is 0, click down button will cause Value be -1, and source got -1, and then, CoerceValueCallback make value to 0, but source still -1. why the CoerceValueCallback called after source updated?? it should be a guard, every change should call it first.

Reproduction Steps

demo here.

WpfNumericUpDown.zip

Expected behavior

all change respect CoerceValueCallback

Actual behavior

CoerceValueCallback not respected

Regression?

No response

Known Workarounds

No response

Impact

No response

Configuration

wpf 9.0-windows

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions