Agent skill · Data & Analytics

maui-collectionview

Guidance for implementing CollectionView in .NET MAUI apps — data display, layouts (list & grid), selection, grouping, scrolling, empty views, templates, incremental loading, swipe actions, and pull-to-refresh. USE FOR: "CollectionView", "list view", "grid layout", "data template", "item template", "grouping", "pull to refresh", "incremental loading", "swipe actions", "empty view", "selection mode", "scroll to item", displaying scrollable data, replacing ListView. DO NOT USE FOR: simple static layouts without scrollable data (use Grid or StackLayout), map pin lists (use Microsoft.Maui.Controls

dotnetgithub.com/dotnetGitHub ↗
claude-codeMIT
Install
npx skills add dotnet/skills --skill maui-collectionview --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 20 KB
Bundled scripts: none
Path: plugins/dotnet-maui/skills/maui-collectionview/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 4,927
Language: C#
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

Review
written from the skill's own SKILL.md · Aug 5, 2026

What it does

Guides developers on using the CollectionView control in .NET MAUI to display scrollable lists or grids, with guidance on when to use it, how to set up item templates, layouts, selection modes, grouping, and common features like pull-to-refresh, incremental loading, empty views, swipe actions, headers/footers, and scrolling actions.

How it works

  • Recommends using CollectionView to display scrollable data, bind to an ObservableCollection, and define a DataTemplate for items.
  • Demonstrates configuring layouts via HorizontalList, VerticalList, or GridItemsLayout for grids with spans and spacings.
  • Describes enabling selection (Single or Multiple) with corresponding bindings (SelectedItem, SelectedItems) and optional selection change commands.
  • Shows how to implement grouping with IsGrouped and a grouped item type, plus a GroupHeaderTemplate for headers.
  • Covers pull-to-refresh by wrapping in a RefreshView and binding IsRefreshing and RefreshCommand.
  • Details incremental loading via RemainingItemsThreshold and related command binding, with a caution against non-virtualizing layouts.
  • Explains SwipeView usage inside DataTemplates for per-item actions, using RelativeSource to reach ViewModel commands.
  • Includes EmptyView usage, header/footer content, and programmatic scrolling with ScrollTo and various ScrollToPosition options.
  • Provides migrating guidance from ListView to CollectionView and notes on common issues during migration.

When to use it

Use when displaying scrollable lists or grids of data, binding to a templated item layout, and needing features like selection, grouping, pull-to-refresh, incremental loading, swipe actions, or an empty state. Do not use for static layouts without scrollable data, map pin lists, table-based forms, or simple text-only lists without interaction.

What it can touch

The skill mentions using CollectionView with:

  • ItemsSource bound to an ObservableCollection<T>
  • DataTemplate with x:DataType for compiled bindings
  • Optional: ItemsLayout, SelectionMode, GroupHeaderTemplate, EmptyView
  • Additional properties and commands for features like RefreshView, incremental loading, and swipe actions

Caveats

  • ViewCell is not allowed as the root of a DataTemplate in CollectionView
  • Use ObservableCollection<T> and mutate on the UI thread
  • Ensure x:DataType is set on DataTemplate for compiled bindings
  • Do not use BindableLayout with virtualization-incompatible layouts for incremental loading
  • Some ListView migration notes apply only when targeting specific frameworks (e.g., .NET 9 vs .NET 10)
From the SKILL.md

# CollectionView — .NET MAUI `CollectionView` is the primary control for displaying scrollable lists and grids of data in .NET MAUI. It replaces `ListView` with better performance, flexible layouts, and no `ViewCell` requirement. ## When to Use - Displaying a scrollable list or grid of data items - Binding a collection of objects to a templated item layout - Adding selection (single or multiple), grouping, or pull-to-refresh - Implementing infinite scroll / incremental loading - Showing swipe actions on list items - Displaying an empty state when no data is available ## When Not to Use - Static layouts with a fixed number of items — use `Grid` or `StackLayout` directly - Map pin lists — use the `Microsoft.Maui.Controls.Maps` NuGet package - Table-based data entry forms — use standard form controls - Simple text-only lists with no interaction — consider `BindableLayout` on a `StackLayout` ## Scope Control — Answer Only What Was Asked This skill is a **reference you consult**, not a checklist you apply. Most requests need one or two sections from it. Pulling in the rest makes the answer worse. **Stop conditions — do NOT act when:** - **The user asked a narrow question.** Answer that

What's inside
Steps it walks through
  1. When to Use
  2. When Not to Use
  3. Scope Control — Answer Only What Was Asked
  4. Inputs
  5. Basic Setup
  6. Layouts
  7. Grid Layout
  8. Horizontal List
  9. Selection
  10. Selection Mode
  11. Selected Visual State
  12. Grouping
  13. Pull-to-Refresh
  14. Incremental Loading (Infinite Scroll)
Ships with 1 file
  • references/collectionview-api.md
More from skills
All skills →
About this skill
What does the maui-collectionview skill do?

Guidance for implementing CollectionView in .NET MAUI apps — data display, layouts (list & grid), selection, grouping, scrolling, empty views, templates, incremental loading, swipe actions, and pull-to-refresh. USE FOR: "CollectionView", "list view", "grid layout", "data template", "item template", "grouping", "pull to refresh", "incremental loading", "swipe actions", "empty view", "selection mode", "scroll to item", displaying scrollable data, replacing ListView. DO NOT USE FOR: simple static layouts without scrollable data (use Grid or StackLayout), map pin lists (use Microsoft.Maui.Controls

How do I install it?

Run `npx skills add dotnet/skills --skill maui-collectionview --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going