Hi to all,
I am developing a wpf desktop app with strict MVVM pattern.
Current my app is doing following things:
- Showing a Treeview with HierarchicalDataTemplate.
- User can expand or collapse Nodes.
- User can add add new Nodes(Drag n Drop + double click).
- Everytime a new Node is added Model is updated and Treeview is recreated based on Model.
- Because Treeview is recreated, all nodes are shown as expanded after adding nodes.
I want to show nodes with their previous expanded condition. Is there any way to do this using MVVM ? What I have thought so far is
- Model should not contain any data related to how to draw UI ??
- VM should just get data from Model and put it in UI(and pass date from UI to Model) ??
Thanks for your thoughts. I may be way far out form rail. But just want to have some wisdom from you guys.
Thanks
PAIJA