maui-data-binding

Implements compiled XAML and C# data bindings for .NET MAUI applications.

1|Updated Jun 1, 2026
One-click install
npx skills add https://github.com/D1ssolve/craft-agents --skill maui-data-binding-d1ssolve
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: maui-data-binding
Source: https://github.com/D1ssolve/craft-agents/tree/main/skills/maui-data-binding
Command: npx skills add https://github.com/D1ssolve/craft-agents --skill maui-data-binding-d1ssolve

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? .NET MAUI developers often ship slow reflection-based bindings, miss change notifications, or hit runtime binding errors that compiled bindings would have caught at build time. This Skill provides guidance for wiring UI controls to ViewModels with compile-time safety and correct change notification. ## Core Features & Use Cases - Compiled Bindings: Set up x:DataType at page roots and DataTemplates, and enforce XC0022/XC0025 warnings as build errors for 8-20x faster bindings. - Change Notification: Implement INotifyPropertyChanged manually or via CommunityToolkit.Mvvm ObservableObject with source-generated properties and commands. - Converters and Advanced Bindings: Create IValueConverter/IMultiValueConverter, use relative bindings, StringFormat, FallbackValue/TargetNullValue, and AOT-safe .NET 9 code bindings with SetBinding lambdas. - Use Case: When building a MAUI page that displays and edits a person's profile, use this Skill to add compiled bindings, pick correct binding modes, format values, and avoid common pitfalls like mutating ObservableCollection off the UI thread. ## Quick Start Ask the AI to add compiled bindings with x:DataType and an ObservableObject ViewModel to your .NET MAUI page.

Frequently Asked Questions about maui-data-binding

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up compiled bindings in .NET MAUI XAML?

Set x:DataType at the page root where BindingContext is assigned and inside every DataTemplate, which creates its own binding scope. Avoid scattering x:DataType on child elements, and add XC0022 and XC0025 to WarningsAsErrors in the csproj to catch binding errors at build time.

Should I use ObservableObject or implement INotifyPropertyChanged manually?

CommunityToolkit.Mvvm ObservableObject is recommended because its source generator creates properties, PropertyChanged raising, and RelayCommand automatically from attributes. Manual INotifyPropertyChanged works but requires boilerplate property setters that raise PropertyChanged events.

When should I specify a BindingMode in .NET MAUI?

Only specify Mode when overriding the control's default. Most display properties default to OneWay and editable controls like Entry.Text default to TwoWay, so adding Mode=OneWay or Mode=TwoWay explicitly is redundant noise.

Why does my .NET MAUI binding not update the UI?

Common causes are a missing BindingContext, a ViewModel that does not implement INotifyPropertyChanged, or binding to non-public properties. Also verify x:DataType is set so XC0022 warnings surface unresolved binding paths at compile time.

Can I update ObservableCollection from a background thread in MAUI?

PropertyChanged events are automatically marshaled to the UI thread, but direct ObservableCollection Add or Remove calls from background threads may crash. Wrap collection mutations in MainThread.BeginInvokeOnMainThread to stay safe.

When should I not use this data binding guidance?

Use dedicated skills for CollectionView item templates and layouts, Shell navigation parameter passing, or dependency injection setup. Property-change-triggered animations should use the built-in .NET MAUI animation APIs instead.