WPF TreeView binding to a simple object
Posted
by esse
on Stack Overflow
See other posts from Stack Overflow
or by esse
Published on 2010-05-12T08:09:03Z
Indexed on
2010/05/12
8:14 UTC
Read the original article
Hit count: 406
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?
© Stack Overflow or respective owner