Agents & OrchestrationSûr100100/100
Maui UI Patterns (.NET)
Fix MAUI UI layout, state, and automation issues. USE FOR: `CollectionView` scrolling, DataTemplate bindings, command bindings, Grid/FlexLayout sizing, binding-driven states, avoiding `ScrollView` parents, stable AutomationIds, `x:DataType`, EmptyView/loading/error states. DO NOT USE FOR: Shell routes, full accessibility, vendor-specific controls.
ou envoie-le directement à ton agent.
Installer dans ton projet
$ curl -fsSL https://arboristhree.xyz/cli/install-skill.mjs -o /tmp/arboris-install-skill.mjs && node /tmp/arboris-install-skill.mjs maui-ui-patterns__dotnet-maui-labs__plugins-dotnet-maui-skills-de0bef3d317a.NET
dotnet/maui-labs
Contenu à copier
---
name: maui-ui-patterns
description: >-
Fix MAUI UI layout, state, and automation issues. USE FOR: `CollectionView` scrolling, DataTemplate bindings, command bindings, Grid/FlexLayout sizing, binding-driven states, avoiding `ScrollView` parents, stable AutomationIds, `x:DataType`, EmptyView/loading/error states. DO NOT USE FOR: Shell routes, full accessibility, vendor-specific controls.
metadata:
origin: .NET
---
# MAUI UI Patterns
Use this skill when creating or reshaping a MAUI page or reusable component.
Prefer readable layouts, shared resources, stable automation hooks, and explicit
UI states over coordinate-based or screenshot-only UI.
## Workflow
1. Inspect the existing UI style: XAML, C# Markup, MauiReactor, or Blazor Hybrid.
If the requested page/component cannot be found but the user asked for a UI
pattern, still provide a self-contained snippet or create the requested file
at a sensible path instead of stopping with only a clarification request.
2. Choose layout primitives based on content:
- `Grid` for structured forms and dashboards.
- `FlexLayout` for wrapping content and responsive chip/card layouts.
- `VerticalStackLayout` / `HorizontalStackLayout` for simple linear groups.
- `CollectionView` for repeated data; avoid wrapping it in `ScrollView`.
3. Move repeated colors, spacing, and text styles into resources.
4. Add `AutomationId` to important interactive elements.
5. Add loading, empty, error, and success states for data-driven screens.
For `CollectionView` loading/empty-state requests, show a visible loading
element such as `ActivityIndicator`, a `CollectionView.EmptyView`, and stable
`AutomationId` values for loading/list/empty elements.
6. Add basic accessibility hooks while building the UI; route deeper audits to
`maui-accessibility`.
7. Verify with build plus DevFlow tree/screenshot when available.
## Layout Guardrails
| Avoid | Prefer |
| --- | --- |
| Absolute coordinates for normal app UI | `Grid`, `FlexLayout`, and adaptive resources |
| Nested `ScrollView` around `CollectionView` | `CollectionView` scrolling directly |
| Fixed `HeightRequest` to force list scrolling | Star-sized `Grid` row so the list receives remaining space |
| Repeated inline colors/margins everywhere | `ResourceDictionary` styles and spacing resources |
| Text-only UI automation | Stable `AutomationId` values |
| One giant page without states | Loading, empty, error, and content states |
| `BindableLayout` for long or incremental lists | `CollectionView` virtualization and incremental loading |
## Example UI State Pattern
```xml
<Grid RowDefinitions="Auto,*">
<ActivityIndicator
AutomationId="products-loading"
IsRunning="{Binding IsBusy}"
IsVisible="{Binding IsBusy}" />
<CollectionView
Grid.Row="1"
AutomationId="products-list"
ItemsSource="{Binding Products}">
<CollectionView.EmptyView>
<Label
AutomationId="products-empty"
Text="No products found."
HorizontalOptions="Center"
VerticalOptions="Center" />
</CollectionView.EmptyView>
</CollectionView>
</Grid>
```
## Typed DataTemplate Command Pattern
When a `DataTemplate` has an item `x:DataType`, bindings inside the template are
scoped to the item, not the page view model. Bind the row root to the item for
automation, and bind commands back to the page view model explicitly:
```xml
<CollectionView
AutomationId="products-list"
ItemsSource="{Binding Products}">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="models:Product">
<Grid AutomationId="{Binding Sku, StringFormat='product-{0}'}">
<Grid.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding Source={RelativeSource AncestorType={x:Type vm:ProductsViewModel}}, Path=SelectProductCommand}"
CommandParameter="{Binding .}" />
</Grid.GestureRecognizers>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
```
Do not remove `x:DataType` just to reach the page command. Use an explicit
source (`RelativeSource`, `x:Reference`, or a binding proxy pattern that matches
the app's conventions) so compiled item bindings remain intact.
## Responsive Patterns
- Use idiom- or platform-specific resources for spacing and column counts.
- Prefer adaptive layout decisions in XAML/resources over platform-specific code
unless behavior truly differs by platform.
- When column widths come from resources, prefer object-element
`ColumnDefinition`/`RowDefinition` syntax. Do not embed
`{StaticResource ...}` inside comma-separated `ColumnDefinitions` strings.
- Keep touch targets large enough for mobile even when the desktop layout is more
dense.
- Test small phone, tablet, and desktop widths when the page is meant to scale.
## Validation Checklist
- Interactive controls have stable `AutomationId`s.
- Repeated styling is moved to resources.
- Data-driven screens have empty/loading/error behavior.
- `CollectionView` is not nested inside a parent `ScrollView`.
- The layout can scale across the intended device sizes.Colle ce Markdown dans ton agent ou utilise les boutons ci-dessus pour l’écrire dans ton projet.
Ce que fait Maui UI Patterns (.NET)
`Grid` for structured forms and dashboards.
`FlexLayout` for wrapping content and responsive chip/card layouts.
`VerticalStackLayout` / `HorizontalStackLayout` for simple linear groups.
`CollectionView` for repeated data; avoid wrapping it in `ScrollView`.
Comment utiliser Maui UI Patterns (.NET)
1
Copie le prompt
Un clic copie le prompt packagé (ou l'envoie à ton agent).
2
L'agent installe le skill
Il ajoute le SKILL.md et ses ressources à ton projet.
3
Activation automatique
Le skill s'active dès que le contexte correspond.
Déclencheurs pour Maui UI Patterns (.NET)
Dis simplement à ton agent quelque chose comme :
Applique le skill maui-ui-patterns__dotnet-maui-labs__plugins-dotnet-maui-skills-de0bef3d317a à cette tâche
Utilise maui-ui-patterns__dotnet-maui-labs__plugins-dotnet-maui-skills-de0bef3d317a pour améliorer cette implémentation
Passe en revue ce sujet avec maui-ui-patterns__dotnet-maui-labs__plugins-dotnet-maui-skills-de0bef3d317a
Skills liés à Maui UI Patterns (.NET)
Acceleration (Microsoft)
Compare synthetic acceleration options and clearly separate scenario value from forecast commitments.Account Overview (Microsoft)
Create a synthetic Acme account overview and identify evidence that merits seller attention.Acroform Writer (Microsoft)
Use this skill whenever the user wants values written INTO an existing PDF form that lives in the connected SharePoint knowledge source — filling out, completing, populating, or submitting a fillable PDF (application, intake sheet, contract, government form) from data they supply, a spreadsheet row, or the conversation. Triggers include "fill out the job application form", "complete the intake form for [person]", "populate our standard NDA template", and "make this ready to send / non-editable" (flatten). The source form should be found via knowledge search; only ask the user to upload it if knowledge search turns up nothing plausible. different task), and do NOT use it on scanned/image-only PDFs that have no real fillable fields — those need OCR or manual overlay instead, which this skill explicitly detects and reports rather than silently failing.