Skip to content

Add an option to opt in to XAML C# Expressions in .NET MAUI 10+ #372

@egvijayanand

Description

@egvijayanand
  • Add an option to opt in to XAML C# Expressions in .NET MAUI 10+
  • This will be an optional Boolean parameter
  • -xce | --xaml-cs-expr - Default value is false
  • Not applicable to earlier versions of .NET MAUI
  • Works better with MVVM opt-in
  • RelayCommand from the MVVM Toolkit does not apply, as it is decorated on the method, making the generated property invisible to the .NET MAUI Source Gen
  • SourceGen option and Preview Features flag will be enabled implicitly
<Label
    FontAttributes="Bold"
    FontSize="18"
    HorizontalOptions="Center"
    Style="{StaticResource MauiLabel}"
    Text="{CountText}" />
dotnet new mauiapp -o MyApp -mvvm -xce

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestprojectPertaining to the project template.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions