MVVM: Thin ViewModels and Rich Models

前端 未结 4 1256
小鲜肉
小鲜肉 2021-01-02 02:35

I\'m continuing to struggle with the MVVM pattern and, in attempting to create a practical design for a small/medium project, have run into a number of challenges. One of t

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-02 03:34

    I agree that there will be tight coupling between the View and ViewModel. But this can be alleviated to some extent by using IValueConverters whenever possible to do transformations.

    I try to keep my business logic in my ViewModel. Also, I use the Viewmodel to change the shape of my Model to fit that which the View might expect.

提交回复
热议问题