C
C#ā€¢13mo ago
Will Pittenger

ā” Can't get root XAML element of UserControl for binding

I have a user control that declares a property that I need to bind properties of its children to. I was trying "{Binding Property, ElementName=window}" for my binding expression. But that seems to fail. It seems user controls don't have a window element. I tried {Binding Property, RelativeSource={RelativeSource AncestorType=UserControl, AncestorLevel=20}} as well, but that doesn't work either. I don't know why. Can someone help? Technically, UserControl isn't my immediate base class. So I tried the intermediate base class as well, but that didn't work. I also tried the derived class to no avail.
4 Replies
sibber
sibberā€¢13mo ago
give it a name and bind
Accord
Accordā€¢13mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Will Pittenger
Will PittengerOPā€¢13mo ago
Haven't had time to get back to this. šŸ˜¦
Accord
Accordā€¢13mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server