MVVM Rules

MVVM follows these simple rules:

• Models don’t talk directly to other classes, although they can emit notifications about data changes.

• View Models talk to Models and expose data to the View Controllers.

  • View Controllers only talk to View Models and Views as they handle view

    lifecycle and bind data to UI components.

  • Views only notify view controllers about events (just as with MVC).

posted @ 2021-10-11 15:38  事不过三寻  阅读(21)  评论(0编辑  收藏  举报