官术网_书友最值得收藏!

Model-View-ViewModel

MVVM was originally coined by Microsoft for use with Windows Presentation Foundation (WPF) and Silverlight. MVVM is a variation of MVC and MVP and further tries to separate the user interface (view) from the business model and application behavior. MVVM creates a new model layer in addition to the domain model that we discussed in MVC and MVP. This model layer adds properties as an interface for the view. Let's say that we have a checkbox on the UI. The state of the checkbox is captured in an IsChecked property. In MVP, the view will have this property and the presenter will set it. However, in MVVM, the presenter will have the IsChecked property and the view is responsible for syncing with it. Now that the presenter is not really doing the job of a classical presenter, it's renamed as ViewModel:

Implementation details of these approaches are dependent on the problem that we are trying to solve and the framework that we use.

主站蜘蛛池模板: 大田县| 涿鹿县| 甘肃省| 吉安市| 共和县| 科尔| 锦屏县| 电白县| 玛曲县| 岱山县| 北安市| 井冈山市| 栖霞市| 岳普湖县| 丹东市| 东丰县| 吐鲁番市| 石门县| 曲麻莱县| 开化县| 大新县| 佛坪县| 达尔| 红原县| 赣州市| 麻城市| 增城市| 商水县| 乃东县| 德令哈市| 祁东县| 台湾省| 津市市| 时尚| 永德县| 丹阳市| 东丽区| 新野县| 遵化市| 陈巴尔虎旗| 海晏县|