Microsoft's WPF brings new technical experience, such as Sliverlight, audio, video, 3D, animation ..., which leads to more detail and customization of the software UI layer. At the same time, at the technical level, WPF has also brought
New features such as binding, Dependency property, Routed Events, Command, DataTemplate, ControlTemplate, etc. MVVM (Model-view-viewmodel) framework
The origin of this is a new architectural framework that evolves when the MVP (Model-view-presenter) model is combined with WPF. It is based on the original MVP framework and combines the new features of WPF
To address the increasingly complex needs of customers.
WPF data binding and presentation model collection are good practices that allow developers to separate view and logic, but this data binding technology is very simple and practical and is unique to WPF
, so we call it Model-view-viewmodel (MVVM). This pattern is similar to the classic MVP (Model-view-presenter) model, except that you need a custom-tailored
Model, this model is viewmodel. ViewModel contains all the UI-specific interfaces and attributes, and is bound by a ViewModel view, and can get loose coupling between the two, so
You need to write the appropriate code in the ViewModel direct update view. Data-binding systems also support validation of input that provides a standardized way to transmit validation errors to views.
The following figure is shown in the MVP design pattern schema.