diff --git a/docs/fundamentals/data-binding/compiled-bindings.md b/docs/fundamentals/data-binding/compiled-bindings.md index d2c60455d..0f9ba36f4 100644 --- a/docs/fundamentals/data-binding/compiled-bindings.md +++ b/docs/fundamentals/data-binding/compiled-bindings.md @@ -283,6 +283,9 @@ static (PersonViewModel vm) => vm.Address?.Street + " " + vm.Address?.City; static (PersonViewModel vm) => $"Name: {vm.Name}"; ``` +> [!WARNING] +> A CS0272 compiler error will occur if the set accessor for a property or indexer is inaccessible. If this occurs, increase the accessibility of the accessor. + In addition, the method sets the binding directly on the object with a `Func`, and returns the binding object instance: ```csharp diff --git a/docs/whats-new/dotnet-9.md b/docs/whats-new/dotnet-9.md index 8b0ceead8..9c25a73bf 100644 --- a/docs/whats-new/dotnet-9.md +++ b/docs/whats-new/dotnet-9.md @@ -1,7 +1,7 @@ --- title: What's new in .NET MAUI for .NET 9 description: Learn about the new features introduced in .NET MAUI for .NET 9. -ms.date: 11/29/2024 +ms.date: 12/13/2024 --- # What's new in .NET MAUI for .NET 9 @@ -258,6 +258,9 @@ static (PersonViewModel vm) => vm.Address?.Street + " " + vm.Address?.City; static (PersonViewModel vm) => $"Name: {vm.Name}"; ``` +> [!WARNING] +> A CS0272 compiler error will occur if the set accessor for a property or indexer is inaccessible. If this occurs, increase the accessibility of the accessor. + In addition, .NET MAUI 9 adds a method that sets the binding directly on the object with a `Func`, and returns the binding object instance: ```csharp @@ -289,6 +292,8 @@ myEntry.SetBinding(Entry.TextProperty, new MultiBinding > [!IMPORTANT] > Compiled bindings are required instead of string-based bindings in NativeAOT apps, and in apps with full trimming enabled. +For more information about compiled bindings in code, see [Compiled bindings in code](~/fundamentals/data-binding/compiled-bindings.md?view=net-maui-9.0&preserve-view=true#compiled-bindings-in-code). + ## Compiled bindings in XAML In .NET MAUI 8, compiled bindings are disabled for any XAML binding expressions that define the `Source` property, and are unsupported on multi-bindings. These restrictions have been removed in .NET MAUI 9. For information about compiling XAML binding expressions that define the `Source` property, see [Compile bindings that define the `Source` property](~/fundamentals/data-binding/compiled-bindings.md?view=net-maui-9.0&preserve-view=true#compile-bindings-that-define-the-source-property).