Understanding MVVM
MVVM was introduced by Microsoft in 2005 and gained popularity with developers following the launch of Windows Presentation Foundation (WPF) and Silverlight because it lends itself so well to building applications with XAML. It is similar to the Presentation Model pattern, which was created by Martin Fowler, one of the most influential proponents of design patterns.
The MVVM pattern consists of the following three layers:
- Model: The Model layer contains the application's business logic and should perform all of the data access operations. The View Model communicates with the Model to retrieve and save the application's data.
- View: The View layer is only responsible for the presentation of data in the application. The layout or structure is defined here, along with style definitions. This is the layer responsible for interacting with the user and receiving input events and data. The View is aware of the View Model only through data-binding...