MVVM – Model-View-ViewModel

 
 
  • Gérald Barré

Model-View-ViewModel (MVVM) is an architectural pattern from Microsoft used in WPF applications. Largely based on the Model-View-Controller (MVC) pattern, MVVM targets Windows Presentation Foundation (WPF) and Silverlight, where user experience (UX) requirements differ from more traditional development approaches.

MVVM leverages WPF-specific features to eliminate most code-behind from the view. Logic that would traditionally live in code-behind is moved to the ViewModel, but in a more generic way. For example, instead of a Button_Click handler, you define a Save method in the ViewModel and bind the button to it. This allows designers to work in XAML and create bindings to the ViewModel maintained by developers, freeing them to focus on UX rather than programming logic.

Rather than going into further detail here, I recommend this article by Josh Smith: WPF Apps With The Model-View-ViewModel Design Pattern.

Along the same lines, I also recommend this video by Jason Dolinger, in which he explains the MVVM pattern and demonstrates how to develop and test a WPF application using it.

A comprehensive article in French by Olivier Dahan: https://www.e-naxos.com/Blog/post/Appliquer-la-pattern-MVVM-avec-MVVM-Light.aspx

Do you have a question or a suggestion about this post? Contact me!

Follow me:
Enjoy this blog?