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
{{ message }}
This repository was archived by the owner on May 1, 2024. It is now read-only.
(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
FindAncestorBindingContextmode do not get re-applied when theBindingContextof 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
AncestorLevelwhen reproducing it for XF. The correct behavior is that anAncestorLevelofnskipsn-1instances of theAncestorTypein the tree. The current behavior is that it skipsn-1levels (regardless of type) in the visual tree.Steps to Reproduce
For (1), simply create a binding using the
FindAncestorBindingContextRelativeSource mode and change theBindingContextof the source during the lifecycle of the app. The bound target will never update.For (2):
Expected:
Label text =
stack1Actual:
Label text =
stack2Resolution
I've coded a fix and more robust unit tests here. If there's no objection will I submit a PR imminently. cc: @StephaneDelcroix