From da4dc26bad30e6e04bec66c6669196f1b53aecea Mon Sep 17 00:00:00 2001 From: ahall Date: Fri, 10 Jul 2026 19:25:47 +0100 Subject: [PATCH] fix: enable compiled Source binding to resolve XamlC XC0025 in TodoApp.MAUI MainPage.xaml's Entry.ReturnCommandParameter binds via an explicit Source={x:Reference addItemEntry}, which XamlC does not compile by default, producing a build warning (XC0025) and falling back to slower reflection-based binding. Enable MauiEnableXamlCBindingWithSourceCompilation project-wide and annotate the binding with x:DataType=Entry so XamlC can compile it. This is the only Source-based binding in the project, so no other bindings are affected. Fixes #517 --- samples/todoapp/TodoApp.MAUI/MainPage.xaml | 2 +- samples/todoapp/TodoApp.MAUI/TodoApp.MAUI.csproj | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/samples/todoapp/TodoApp.MAUI/MainPage.xaml b/samples/todoapp/TodoApp.MAUI/MainPage.xaml index 0a804732..b06b9c36 100644 --- a/samples/todoapp/TodoApp.MAUI/MainPage.xaml +++ b/samples/todoapp/TodoApp.MAUI/MainPage.xaml @@ -55,7 +55,7 @@ Completed="OnAddItemEntryCompleted" Placeholder="Enter Todo Item Text" ReturnCommand="{Binding AddItemCommand}" - ReturnCommandParameter="{Binding Text, Source={x:Reference addItemEntry}}" + ReturnCommandParameter="{Binding Text, Source={x:Reference addItemEntry}, x:DataType=Entry}" Style="{StaticResource addItemEntry}" /> diff --git a/samples/todoapp/TodoApp.MAUI/TodoApp.MAUI.csproj b/samples/todoapp/TodoApp.MAUI/TodoApp.MAUI.csproj index df0379ee..c87993ae 100644 --- a/samples/todoapp/TodoApp.MAUI/TodoApp.MAUI.csproj +++ b/samples/todoapp/TodoApp.MAUI/TodoApp.MAUI.csproj @@ -43,6 +43,18 @@ See https://github.com/CommunityToolkit/Datasync/issues/521. --> true + + + true