开发者

I need a ObservableCollection of tree levels

开发者 https://www.devze.com 2023-01-24 20:34 出处:网络
i need to create a ObservableCollection<> for tree o more levels in c# like this: 开发者_Go百科

i need to create a ObservableCollection<> for tree o more levels in c# like this:

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)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号