Reputation: 1057
Is there a way to bind a property of the listboxitem to one of it's owning listbox? I want it in a template so I believe that rules out ElementName.
Upvotes: 1
Views: 147
Reputation: 15247
Use the FindAncestor
mode of the Binding
class. Like this:
{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBox}}, Path=YourProperty}
Upvotes: 3