Implement WPF treeview with different Parent Nodes a well as different child nodes?

后端 未结 3 935
Happy的楠姐
Happy的楠姐 2020-12-09 07:19

I want to implememt a tree view with has the following structure.....

[RootNode] <---- Root of tree
--[ParentNode P1] <---- Object of ModelClass P1<

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-09 07:44

    Is it possible you can post further details of your solution. I'm trying to achieve the same thing, I've added multiple hierarchicaldatatemplates but would be interested in seeing the object model.

    In my case I've got a Parent with the following properties

    Public string Name { get; set; }
    Public ObservableCollection ChildrenA { get; set; }
    Public ObservableCollection ChildrenB { get; set; }
    

    I want to show these in my treeview. Would be interested in knowing how I might structure the object model as I need something to display in the tree at the level above the individual ChildA and ChildB collections.

提交回复
热议问题