dotnet / dotnet/maui

Make data binding consistent between Debug and Release builds

Open
#33,804 2 comments 0 reactions 0 assignees View on GitHub
proposal/open
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

### Description

I have had numerous bugs reported by my test team that turned out to be related to data binding, only repro in Release mode, and do not manifest in the XAML Binding Failures Visual Studio tool window in both Debug and Release modes.

Some of them turned out to be simple mistakes, where the x:DataType was simply wrong, but others are less obvious and some feel unexplainable; for example, relative bindings to ancestor BindingContext that worked in Xamarin.Forms and stopped working in MAUI, but when I change to FindAncestor and bind to the ancestor's BindingContext they work.

I am proposing that **data binding behavior be unified between Debug and Release** to reduce frustration and confusion. Having worked with Xamarin, WPF, and XAML in general for many years, I understand the underlying concepts of data binding, but I can imagine for newer developers this experience would be off-putting and discouraging.

### Public API Changes

No API changes should be necessary to support this change.

### Intended Use-Case

The use case is a consistent and reliable developer experience. I understand there are edge cases where Release mode assembly linking, trimming, and other optimizations can alter the runtime, but the data binding engine should not be subject to these differences.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing a representative XAML data-binding case in both Debug and Release builds, including the reported ancestor BindingContext behavior and an incorrect x:DataType. Compare runtime binding results with the XAML Binding Failures tool window. Done means binding behavior and diagnostic visibility are consistent between the two build modes without API changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
frontend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.