You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(1) RelativeSource bindings using the FindAncestorBindingContext mode do not get re-applied when the BindingContext of any of the ancestors changes without re-parenting. This may or may not be the problem @IoTFier was having but investigating his issue led to my discovery of this problem.
(2) I misinterpreted the WPF documentation for AncestorLevel when reproducing it for XF. The correct behavior is that an AncestorLevel of n skips n-1 instances of the AncestorType in the tree. The current behavior is that it skips n-1 levels (regardless of type) in the visual tree.
Steps to Reproduce
For (1), simply create a binding using the FindAncestorBindingContext RelativeSource mode and change the BindingContext of the source during the lifecycle of the app. The bound target will never update.
Description
(1) RelativeSource bindings using the
FindAncestorBindingContext
mode do not get re-applied when theBindingContext
of any of the ancestors changes without re-parenting. This may or may not be the problem @IoTFier was having but investigating his issue led to my discovery of this problem.(2) I misinterpreted the WPF documentation for
AncestorLevel
when reproducing it for XF. The correct behavior is that anAncestorLevel
ofn
skipsn-1
instances of theAncestorType
in the tree. The current behavior is that it skipsn-1
levels (regardless of type) in the visual tree.Steps to Reproduce
For (1), simply create a binding using the
FindAncestorBindingContext
RelativeSource mode and change theBindingContext
of the source during the lifecycle of the app. The bound target will never update.For (2):
Expected:
Label text =
stack1
Actual:
Label text =
stack2
Resolution
I've coded a fix and more robust unit tests here. If there's no objection will I submit a PR imminently. cc: @StephaneDelcroix
The text was updated successfully, but these errors were encountered: