What problem does it solve?
Mobile and desktop MAUI apps need a performant, flexible way to display scrollable lists and grids of data without the complexity and limitations of legacy ListView patterns. CollectionView provides virtualization, flexible layouts, item templates, selection, grouping, and common UX behaviors so developers can build responsive item lists and grids that scale.
Core Features & Use Cases
- Display lists and grids using LinearItemsLayout or GridItemsLayout for vertical, horizontal, or multi-column arrangements.
- Selection support with Single or Multiple modes and visual state styling to highlight selected items.
- Grouping with group header and footer templates for category-based catalogs.
- Pull-to-refresh via a RefreshView wrapper and incremental loading using RemainingItemsThreshold and RemainingItemsThresholdReachedCommand for infinite scroll.
- EmptyView and EmptyViewTemplate support to show custom empty states when the source collection is empty.
- Swipe actions on items and programmatic scrolling using ScrollTo for chat or message feeds.
- Use case example: a 2-column recipe grid showing image, title, and prep time with SelectionMode=Single and a ViewModel exposing an ObservableCollection and SelectedItem.
Quick Start
Create a CollectionView with a GridItemsLayout Span=2, bind ItemsSource to an ObservableCollection in your ViewModel, set SelectionMode to Single, and add a SelectedItem property with INotifyPropertyChanged.