Back to Blog

research

CollectionView in .NET MAUI: A Skill Agents Can Actually Use

Scenario-driven guide to adding the maui-collectionview agent skill for building MAUI lists, grids, selection, grouping, and pull-to-refresh.

OpenAgentSkillPublished:

Where this fits

You're building a MAUI inventory screen that shows grouped products, supports swipe-to-delete, and loads more items as the user scrolls. Without concrete CollectionView guidance, agents often invent APIs or default to outdated ListView patterns. This skill gives an agent the specific implementation rules for CollectionView—layouts, templates, selection, grouping, scrolling, and refresh—so it can generate code that compiles and behaves correctly.

Why agents benefit

  • It can choose CollectionView only when scrollable data is actually involved, and fall back to Grid/StackLayout for static screens.
  • It can produce DataTemplates with correct bindings for list and grid layouts, avoiding MVVM binding mistakes that only appear at runtime.
  • It can implement pull-to-refresh and incremental loading using the right CollectionView properties and commands, not guessed event handlers.
  • It can handle selection modes, empty views, and scroll-to-item with the exact enum and method names the control expects.
  • It knows the skill's boundaries, so it won't wander into platform-specific renderer issues or diagnose framework bugs when the problem is application-level.

Practical scenarios

Grouped product catalog with incremental loading

An e-commerce app needs a grid of products grouped by category, with more items loaded when the user reaches the end. The skill guides the agent to set IsGrouped="True", choose a GridItemsLayout with Span, and bind RemainingItemsThreshold to a command.

Activity feed with pull-to-refresh and swipe actions

A social app shows a scrollable feed where users refresh for new posts and swipe to favorite or archive. The agent uses RefreshView for pull-to-refresh and SwipeView inside the DataTemplate for actions, while keeping the list virtualized.

Search results with an empty view

A support app needs to show "No results found" when a search returns nothing. The skill points to CollectionView.EmptyView, so the agent can render a friendly empty state instead of leaving a blank screen.

Add it to your agent workflow

Install the skill with:

npx skills add managedcode/dotnet-skills --skill maui-collectionview

Then reference it explicitly in your agent prompt or project instructions:

Use the maui-collectionview skill to implement this list. It should be a grid
with grouping, pull-to-refresh, and an empty view. Do not use ListView.

The agent will load the skill's guidance before generating code and stay within its boundaries.

Compare before adopting

Before adding this skill, compare it with alternatives: does your question involve scrollable list data, or is a simple StackLayout enough? Check the skill's README for explicit use and non-use cases, and verify how recently it was updated for MAUI API changes. Also consider whether other skills like maui-data-binding cover part of your MVVM binding needs; using the right skill avoids overlap and hallucinated APIs.

Why it is worth tracking

This skill is part of managedcode/dotnet-skills, a repository with 477 stars and an MIT license, which signals community use and low adoption friction. It stays focused on a single, common problem: getting CollectionView right in MAUI. For ongoing signal, track this skill's page at https://www.openagentskill.com/skills/managedcode-maui-collectionview and re-evaluate it when MAUI releases change CollectionView behavior or when the skill's scope expands or becomes stale.

Featured Skill

maui-collectionview

Skill by managedcode