Navigation and Pages using Model-View-ViewModel (MVVM)
I am working on a project at work that is a navigation application.
I wanted to use MVVM. I also wanted to document for others how I designed this, as there wasn’t much online about using MVVM with Navigation and Pages.
Here is my project. I will post an explanation of this project as soon as I can get to it, so look for it.
Project Download – Small: Navigation-Pages-MVVM.zip
Project Download – More complete: Navigation-Pages-MVVM 2.0
Dude, thank you very much for this.
Indeed, documentation for MVVM + Navigation without any third party is escarse.
Happy to provide.
I try not to use third party libraries until the project truly calls for it.
I also try not to include 3rd party libraries in example code.
I think it’s not the best idea to create view instances in view model class. It makes much more difficult to write unit tests for this view model.
In production we have an IController interface and a concrete Controller that we pass into the ViewModels with Dependency Injection and the on click goes next.
To pull this into a publishable example and exclude my company specific code, it was simplified and dependency injection was excluded.
Pretty good example about wpf + mvvm with navigation.
Simple and elegant.