WPF TreeView binding to a simple object
- by esse
I have a simple object as such:
public class Info
{
public string Name {get; set;}
public int Count {get; set;}
public DateTime TimeStamp {get; set;}
}
I want to bind a collection of these objects to a WPF TreeView and have the properties on the Info objects show up as sub TreeViewItems, like so:
Item 1
Name: Bill
Count: 3
TimeStamp: 12/05/2010 09:06:00 AM
Item 2
Name: Chris
Count: 22
TimeStamp: 11/05/2010 11:34:00 AM
Item 3
Name: Toby
Count: 1
TimeStamp: 09/05/2010 05:55:00 PM
How can I achieve this through XAML?