MVVM and Controller Objets

Topics: Prism v4 - WPF 4
Jun 30, 2011 at 9:59 PM

I do not quite understand what the purpose of the Controller objects.
I have read some documentation on its use in the implementation of projects based on MVVM yet I hardly see when creating a Controller in a ViewModel.

The main idea is that objects MVVM ViewModel contain only data that are displayed in the view, and manipulation of them through commands.
But if I have an operation that removes a database record, who has a responsibility to refresh the data in the view? The Controller? The ViewModel?, Who is the one to have a reference to data repository?

Jul 1, 2011 at 5:04 PM


Take into account that in MVVM presentation pattern, the View Model is responsible for updating the View. The controller’s responsibility is to interact with your repository and updating view model's values. Also cab be shared between multiple view models.

In Prism documentation MSDN, Appendix B: Patterns in Prism Library covers all the patterns used in the library.


Miguel Bronzovic