Hi, I'm having some trouble with a databound TreeView in WPF, basically I want a context menu to be databound to an IEnumerable property on my TreeViewItem ViewModel, this is what I'm trying to do in the of each TreeViewItem:
<Setter Property="ContextMenu">
<Setter.Value>
<ContextMenu ItemsSource="{Binding ContextMenu}" />
</Setter.Value>
but it gives me an exception when loading the xaml saying it can't set ContextMenu on System.Object or something along those lines.
Can anyone shed some light on this?
Thanks