maui-data-binding

Guide .NET MAUI data binding with compiled bindings and converters.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Petelids/Sudoku --skill maui-data-binding-petelids
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: maui-data-binding
Source: https://github.com/Petelids/Sudoku/tree/main/skills/maui-skills/maui-data-binding
Command: npx skills add https://github.com/Petelids/Sudoku --skill maui-data-binding-petelids

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

MAUI developers often struggle with configuring robust data-binding across views, leading to maintenance burdens, performance concerns, and subtle binding bugs. This guide provides clear, actionable patterns for XAML data bindings, compiled bindings, converters, binding modes, multi-binding, relative bindings, and MVVM best practices.

Core Features & Use Cases

  • Guidance on binding modes (OneWay, TwoWay, OneWayToSource, OneTime) and practical usage.
  • Techniques for compiled bindings with x:DataType to improve performance and type safety.
  • Implementations of IValueConverter, IMultiValueConverter, and value converters to transform data in MVVM flows.
  • Relative bindings, MultiBinding usage, and BindingContext management.

Quick Start

Open a MAUI project and apply the provided data-binding guidelines to bind a ViewModel to a page's UI elements.

Frequently Asked Questions about maui-data-binding

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

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

To use compiled bindings in .NET MAUI XAML, set the x:DataType attribute on your visual elements to explicitly declare the BindingContext type. This enables compile-time type checking, improves binding performance, and prevents reflection-based trimming failures.

What is the difference between MAUI binding modes like OneWay and TwoWay?

MAUI binding modes define data synchronization direction: OneWay updates the target from the source, TwoWay synchronizes both directions, OneWayToSource pushes target changes back to the source, and OneTime sets the target property only once during initialization.

How do I create an IValueConverter for .NET MAUI data binding?

To create an IValueConverter for .NET MAUI data binding, implement the Convert and ConvertBack methods to transform data between the source and target properties. This enables custom data formatting and type conversion within your MVVM XAML views.

Can I use relative bindings and MultiBinding in .NET MAUI?

Yes, .NET MAUI supports relative bindings to reference properties on element ancestors or the element itself, and MultiBinding to combine multiple binding sources into a single target property using an IMultiValueConverter implementation for the aggregated result.

What's the best way to manage BindingContext in a MAUI MVVM application?

The best way to manage BindingContext in a MAUI MVVM application is to explicitly set the ViewModel instance and pair it with x:DataType for compiled bindings. This approach ensures reliable UI updates, enforces type safety, and reduces subtle binding bugs.

Why are my MAUI XAML compiled bindings failing under trimming?

MAUI XAML compiled bindings fail under trimming when standard runtime bindings rely on reflection, which trimmers remove. By applying x:DataType to enforce compiled bindings, you eliminate reflection and ensure type-safe, trimming-resistant data binding.