I am porting an existing WPF application to MVVM pattern and I am using the RadTreeView. I am dynamically populating the Items collection at runtime of the RadTreeViewItem depending on whether a user has selected a Category node or a Object node.
In a MVVM pattern, I am unsure of how to do this while preserving the state of the Treeview (selected, what is expanded). So what would I do in the ViewModel and View to have this work? Would I have to create a class that would emulate the Items collection? How do I preserve the state?
So I might have something like this:
Divisions
--- AFC West (Category)
--- AFC South (Category)
------ Colts (Object)
----------QBs (Category)
-------------Peyton Manning (Object)
-------------Curtis Painter (Object)
In a MVVM pattern, I am unsure of how to do this while preserving the state of the Treeview (selected, what is expanded). So what would I do in the ViewModel and View to have this work? Would I have to create a class that would emulate the Items collection? How do I preserve the state?
So I might have something like this:
Divisions
--- AFC West (Category)
--- AFC South (Category)
------ Colts (Object)
----------QBs (Category)
-------------Peyton Manning (Object)
-------------Curtis Painter (Object)