I need a ObservableCollection of tree levels
i need to create a ObservableCollection<> for tree o more levels in c# like this:
- 开发者_Go百科
- Group 1
- Group 2
- Group 1
- Group 2
- Group 1
- Group 2
- Group 3
thanks in advance,
Timmy Leonard
make a "node" class that contains an observable collection of child nodes, like this:
class node
{
// add some data properties in here, too
public ObservableCollection<node> children;
}
// declare an instance, in the data model (or where-ever)
ObservableCollection<node> RootLevel = new ObservableCollection<node>();
I could probably give you a better answer if I knew what platform your trying to do this for. (WPF or Silverlight, etc)
精彩评论