Well, I answered my own question, but I dont think it's the right way to go about this.
I used an itemtemplate on the treeview and then created another treeview inside of that template with another itemtemplate on it.
I can however, understand this when I look at it vs looking at the HierarchicalDataTemplates.
WPF:
<TreeView HorizontalAlignment="Left" Name="treeView1" VerticalAlignment="Top">
<TreeView.ItemTemplate>
<DataTemplate>
<TreeViewItem Header="{Binding FileName}">
<TextBlock Text="{Binding MetaData1}"/>
<TextBlock Text="{Binding MetaData2}"/>
<TreeViewItem ItemsSource="{Binding Mappings}" Header="Mappings">
<TreeViewItem.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="17"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding Original}" Grid.Column="0"/>
<TextBlock Text="->" Grid.Column="1" Margin="3,0,3,0"/>
<TextBlock Text="{Binding Mapping}" Grid.Column="2"/>
</Grid>
</DataTemplate>
</TreeViewItem.ItemTemplate>
</TreeViewItem>
</TreeViewItem>
</DataTemplate>
</TreeView.ItemTemplate>
</TreeView>
Classes:
public class ClassA
{
public string MetaData1 { get; set; }
public string MetaData2 { get; set; }
public string FileName { get; set; }
public List<ClassB> Mappings { get; set; }
}
public class ClassB
{
public string Original { get; set; }
public string Mapping { get; set; }
}
Quick Implementation of my data structure:
new List<ClassA>
{
new ClassA
{
FileName = "ClassA 1",
MetaData1 = "Prop 1",
MetaData2 = "Prop 2",
Mappings = new List<ClassB>
{
new ClassB
{
Original = "BProp 1",
Mapping = "BProp 2"
}
}
},
new ClassA
{
FileName = "ClassA 2",
MetaData1 = "Prop 1",
MetaData2 = "Prop 2",
Mappings = new List<ClassB>
{
new ClassB
{
Original = "BProp 1",
Mapping = "BProp 2"
}
}
}
};
If anyone knows how I should have done this better (with HierachicalDataTemplates and DataTemplates Im open to seeing that code and improving upon this.