TreeView binding issue in WPF

Posted by Michael Stoll on Stack Overflow See other posts from Stack Overflow or by Michael Stoll
Published on 2010-03-23T22:49:25Z Indexed on 2010/03/23 22:53 UTC
Read the original article Hit count: 189

Filed under:
|
|

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

© Stack Overflow or respective owner

Related posts about wpf

Related posts about xaml