WPF binding to nested objects in a ResourceDictionary
-
29-09-2019 - |
Question
I have an object tree which is included in a ResourceDictionary in my application. The root node of this object tree has an x:Key associated with it. I want to bind a control to a property of one of the nested items in this tree. How can I get access to a child element of a keyed ResourceDictionary to allow me to do this?
Solution
Something like this:
<MyControl
MyProperty="{Binding Source={StaticResource MyResourceKey}, Path=ChildProperty.Children[1].AndSoOn}"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow