Skip to content

.NET MAUI 9: Compiled bindings can be used with C# markup #2304

@davidbritch

Description

@davidbritch

In .NET MAUI 9, compiled bindings can be used with C# markup (to replace reflection-based bindings with string paths).

Example:

// in .NET 8
MyLabel.SetBinding(Label.TextProperty, "Text");

// in .NET 9
MyLabel.SetBinding(Label.TextProperty, static (Entry entry) => entry.Text);

This new approach has several advantages:

This approach is required instead of string-based bindings in NativeAOT apps, and in apps with full trimming enabled.

More info: dotnet/maui#21725


Associated WorkItem - 314390

Metadata

Metadata

Assignees

Labels

🏁 Release: .NET 10Work items for the .NET 10 release📌 seQUESTeredIdentifies that an issue has been imported into Quest.Pri3doc-enhancementImprove the current content [org]resolved-by-customerIndicates issues where the customer no longer needs any help. [org]

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions