I am using WPF and trying to program the MVVM path.
I understand how each view has its own look model, and it works quite well. I try my best to manage the interaction between the views.
Let's say I have two views: View1 and View2, each with its own ViewModel, ViewModel1 and ViewModel2. If I have a combobox on View1 and a button, then what is the correct way to close the first view, notify the second view of the selection and show the second view after clicking the button? It does not seem to have to go in the model because it is a user interface. The ViewModel should not know how to open and close WPF forms (or should it?) And the views should not know about any other ViewModels (or should they?)
So how are these problems solved? In a nutshell:
1) How are data transferred between views?
2) What controls the lifetime / visibility of views?
source
share