I am a newbie in MVVM/WPF and try to use MVVM design pattern. I refer this tutorial https://www.codeproject.com/Articles/26288/Simplifying-the-WPF-TreeView-by-Using-the-ViewMode to work with treeview and database.
I know that I can change Treeview selected Item and refer on it I can change in database also. I don't know is that the right way to work with treeview and database.
For example, I have database
ID Name
1 A
2 B
I use MVVM to populate it in treeview
A
|- B
Now, when rename node B to C. I need to search id of B in database and rename it also. Is that the right way to work with my idea or is there any better way to achieve it?
I know we can using like this article Binding TreeView to DataSet But it not use MVVM and some MVVM's features can't be applied.