This article explains how to reduce coupling between ViewModels in MVVM applications by combining an INavigationService to handle window navigation with the MVVM Toolkit’s WeakReferenceMessenger for communication. Instead of directly referencing views or other ViewModels, each ViewModel sends and receives lightweight messages (e.g., for closing windows or deleting items), making components easier to maintain, test, and extend.
Tag: MVVM
The MVVM Pattern revisited with the MVVM Community Toolkit 8.0
Sometime ago, I’ve written this article introducing the MVVM Community Toolkit and developing a CRUD application to show how to use the MVVM pattern with the Community toolkit. The time has passed…
Implementing the MVVM pattern in a WPF app with the MVVM Community toolkit
Introduction You have an old, legacy app (with no tests), and its age is starting to show – it’s using an old version of the .NET Framework, it’s difficult to maintain and…
Restructuring your legacy code using MVVM and Dependency Injection with Unity
Introduction In the previous article, "Testing the untestable with Fakes", I have shown how to create unit tests for the legacy code that didn’t allow tests. With these tests in place we…