Skip to content

Why don't .NET MAUI 9 C# compiled bindings support source-generated properties? #25988

@egvijayanand

Description

@egvijayanand

Description

Why don't .NET MAUI 9 compiled bindings support source-generated properties?

When I tried to use the MVVM Toolkit feature for a source-generated property from a backing field and bound it to the newly defined SetBinding call, I received this build error message.

If XAML can work with this property binding, why is C# raising an issue? Support for SG-properties is very crucial in the current context.

Error message: The lambda result type cannot be resolved. Make sure that soruce generated fields / properties are not used in the path.

// Defined within the Page constructor
this.SetBinding(Page.TitleProperty, static (MainViewModel vm) => vm.Title);

Public API Changes

Ability to resolve the compilation context with the SG-generated source files.

Intended Use-Case

Potential use of source-generated (SG) toolkits, including the officially supported CommunityToolkit.Mvvm package.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions