I've used the example explaining how to create a windows explorer-like treeview, where a collection of children can contain both directories and files but I think I need a bit of clarification.
I'm in an MVVM scenario and my model classes contain multiple collections representing the different kinds of children they can contain. For example I might have grocery store object with a collection of dairy products, another collection of meats, etc. Is it correct that my view model should merge the collections into a single observable collection of objects (or something less general if possible) and then rely on the DataType={x:Type ....} to chose the right data template?
If that is the case and I wanted to keep my collection sorted, I would have to implement a custom sorter to group the dairy and meats prior to sorting, correct? Also, this should all still work if the children themselves can be containers for multiple types?