TreeView binding issue in WPF
- by Michael Stoll
Consider the following data structure:
List<Person> People;
class Person {
List<Car> Cars;
List<Hobby> Hobbies;
}
I want to bind a TreeView to this structure. And it should look like this:
People
> Frank
> Cars
> BMW
> Ford
> Hobbies
> Tennis
> Golf
> Jane
> Cars
> Hobbies
How can this be achieved in XAML?
This is a follow up question to binding-a-treeview-with-contextmenu-in-xaml