I have the following question regarding MVVM light: what "drives" the UI? I see I can have a ViewModel per View I am showing; the ViewLocator handles all the ViewModels (for caching as I understand). But what is driving the UI?
If I have a Command defined in my ViewModel that says "ShowDetail"; do I have to write the code for displaying this View inside the ViewModel?
Are there any examples of this? Thanks!
The MVVM pattern by itself doesn't have anything specific for navigation between views. Although, there are many solutions for that in several frameworks. The most common solution is to use some sort of controller that "orchestrates" the main View, or to use a "Master-Detail" approach for subviews.
Some interesting solutions:
I have created a T4 template that generates code and shows how to navigate to a uri or object, or close a window (wpf). It works with mvvm light
Download here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With