Fix #17674: OneWay binding fails to update target after local change by martimclaudino · Pull Request #20964 · AvaloniaUI/Avalonia (original) (raw)

@martimclaudino

…al change

When a OneWay binding target is modified locally (e.g., via user interaction on a ToggleButton), subsequent PropertyChanged events from the source were being ignored. This occurred because the binding expression incorrectly suppressed the update.

This patch modifies UntypedBindingExpressionBase to ensure that OneWay bindings always propagate changes from the source to the target, overriding any previous local changes. Unit tests were also added to prevent future regressions on this behavior.

Signed-off-by: Martim Claudino martimffclaudino@tecnico.ulisboa.pt

@MrJul MrJul mentioned this pull request

Apr 8, 2026

3 tasks

@martimclaudino

…nd clean usings

Signed-off-by: Martim Claudino martimffclaudino@tecnico.ulisboa.pt

@martimclaudino martimclaudino changed the titleFix #20816: OneWay binding fails to update target after local change Fix #17674: OneWay binding fails to update target after local change

Apr 9, 2026

MrJul pushed a commit to MrJul/Avalonia that referenced this pull request

Apr 28, 2026

@martimclaudino @MrJul

…al change (AvaloniaUI#20964)

When a OneWay binding target is modified locally (e.g., via user interaction on a ToggleButton), subsequent PropertyChanged events from the source were being ignored. This occurred because the binding expression incorrectly suppressed the update.

This patch modifies UntypedBindingExpressionBase to ensure that OneWay bindings always propagate changes from the source to the target, overriding any previous local changes. Unit tests were also added to prevent future regressions on this behavior.

Signed-off-by: Martim Claudino martimffclaudino@tecnico.ulisboa.pt

Signed-off-by: Martim Claudino martimffclaudino@tecnico.ulisboa.pt


Signed-off-by: Martim Claudino martimffclaudino@tecnico.ulisboa.pt

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})