Should my ViewModel have an ObservableCollection of Views or ViewModels?

前端 未结 3 1479
无人共我
无人共我 2021-02-04 11:22

I\'m trying to understand the basic MVVM design approach when using ItemsControl by binding it via DataTemplates to ObservableCollectio

3条回答
  •  我寻月下人不归
    2021-02-04 12:05

    I like using an ObservableCollection of ViewModels. The view that binds to the collection can define a DataTemplate that gives the ViewModel its look. This leads to less coupling among the components.

提交回复
热议问题