I need to show items from two different sources in my Tree View. How can I achieve that?
Details: Item source A: This item source will have a header, n children, where each child can have up to 32 sub children.
Item source B: This item source will have a header and n children.
I need to support context menu operations on the children and sub children.
What should the xaml code look like and what should be the structure of my classes?
My current structure has only one ItemSource and the binding code looks like this
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Slash}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}"/>
</StackPanel>
<HierarchicalDataTemplate.ItemTemplate>
<DataTemplate DataType="{x:Type dt:Slash}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding FullName}"/>
</StackPanel>
</DataTemplate>
</HierarchicalDataTemplate.ItemTemplate>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>