C
C#ā€¢7mo 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ā€¢7mo ago
give it a name and bind
Accord
Accordā€¢7mo 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 Pittengerā€¢7mo ago
Haven't had time to get back to this. šŸ˜¦
Accord
Accordā€¢7mo 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
More Posts