In MVVM, is every ViewModel coupled to just one Model?

前端 未结 7 1121
日久生厌
日久生厌 2020-12-04 17:04

In an MVVM implementation, is every ViewModel coupled to just one Model?

I am trying to implement the MVVM pattern in a project but I found

相关标签:
7条回答
  • 2020-12-04 17:36

    You can use multiple models in a view model. The purpose of the view model is to abstract away the business / data layer (i.e. the model).

    However, using more than one model usually indicates that the view is too large. You might want to split it into user controls (which have their own view models).

    0 讨论(0)
提交回复
热议问题