Is it better to bind CollectionView to domain models or lightweight item view models?

Platform: .NET MAUI| Category: Collection View

It is better to use lightweight item view models implementing INotifyPropertyChanged. They provide predictable UI updates, support local UI state, and keep domain models free of UI responsibilities.

public class ItemVM : INotifyPropertyChanged
{
  public string Title { get; set; }
  /*...*/
}

public ObservableCollection<ItemVM> Items { get; } = new ObservableCollection<ItemVM>();

<CollectionView ItemsSource="{Binding Items}" />

Share with