Posts

Showing posts with the label treeview

Nested XAML Treeview Structure with mixed object types

Nested XAML Treeview Structure with mixed object types So I've been working on a complex treeview structure using WPF binding. None of the scenarios I've found online have been able to solve the issue, but they have come close. So I have three objects that look something this: public class A { public string Name {get; set;} public List<A> ListOfA {get; set;} public List<B> ListOfB {get; set;} } public class B { public string Name {get; set;} public List<C> ListOfC {get; set;} public List<D> ListOfD {get; set;} } public class C { public string Name {get; set;} public List<D> {get; set;} } public class D { public string Name{get; set;} } It should be noted that the ListOfA, ListOfB, ListOfC, and ListOfD can all be empty. I know this seems convoluted, but it makes perfect sense for my application as to why I'd be doing it this way. Below is an example of what the treeview could look like A - Name | - A - Nam...