From 7732e0279ba8f45653a61b7f03aea04a3a62bcb6 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Wed, 15 Mar 2023 16:12:53 -0400 Subject: [PATCH] Remove @bind:{get|set|after} feature NOTEs (#28683) --- aspnetcore/blazor/components/data-binding.md | 48 -------------------- 1 file changed, 48 deletions(-) diff --git a/aspnetcore/blazor/components/data-binding.md b/aspnetcore/blazor/components/data-binding.md index 66662b7a69..d692083f16 100644 --- a/aspnetcore/blazor/components/data-binding.md +++ b/aspnetcore/blazor/components/data-binding.md @@ -47,11 +47,6 @@ To execute asynchronous logic after binding, use `@bind:after="{EVENT}"` with a Using an event callback parameter (`[Parameter] public EventCallback ValueChanged { get; set; }`) with `@bind:after` isn't supported. Instead, pass a method that returns an or to `@bind:after`. -> [!IMPORTANT] -> The `@bind:after` feature is receiving further updates at this time. To take advantage of the latest updates, confirm that you've installed the [latest SDK](https://dotnet.microsoft.com/download). Visual Studio updates to support the feature are planned for the mid-February Visual Studio release. -> -> For more information, see [Blazor `@bind:after` not working on .NET 7 RTM release (dotnet/aspnetcore #44957)](https://github.com/dotnet/aspnetcore/issues/44957). - In the following example: * The `` element's `value` is bound to the value of `searchText` synchronously. @@ -115,11 +110,6 @@ Components support two-way data binding by defining a pair of parameters: * `@bind:get`: Specifies the value to bind. * `@bind:set`: Specifies a callback for when the value changes. -> [!IMPORTANT] -> The `@bind:get` and `@bind:set` features are receiving further updates at this time. To take advantage of the latest updates, confirm that you've installed the [latest SDK](https://dotnet.microsoft.com/download/dotnet/7.0). Visual Studio updates to support the feature are planned for the mid-February Visual Studio release. -> -> For more information, see [Blazor `@bind:after` not working on .NET 7 RTM release (dotnet/aspnetcore #44957)](https://github.com/dotnet/aspnetcore/issues/44957). - The `@bind:get` and `@bind:set` modifiers are always used together. Using an event callback parameter with `@bind:set` (`[Parameter] public EventCallback ValueChanged { get; set; }`) isn't supported. Instead, pass a method that returns an or to `@bind:set`. @@ -438,18 +428,6 @@ In the following example, the `PasswordUpdated` method executes asynchronously a ## Bind across more than two components - - -You can bind parameters through any number of nested components, but you must respect the one-way flow of data: - -* Change notifications *flow up the hierarchy*. -* New parameter values *flow down the hierarchy*. - -A common and recommended approach is to only store the underlying data in the parent component to avoid any confusion about what state must be updated, as shown in the following example. - -`Pages/Parent2.razor`: - -:::code language="razor" source="~/../blazor-samples/6.0/BlazorSample_WebAssembly/Pages/data-binding/Parent2.razor"::: - -`Shared/NestedChild.razor`: - -:::code language="razor" source="~/../blazor-samples/6.0/BlazorSample_WebAssembly/Shared/data-binding/NestedChild.razor"::: - -> [!WARNING] -> Generally, avoid creating components that write directly to their own component parameters. The preceding `NestedChild` component makes use of a `BoundValue` property instead of writing directly to its `ChildMessage` parameter. For more information, see . - -`Shared/NestedGrandchild.razor`: - -:::code language="razor" source="~/../blazor-samples/6.0/BlazorSample_WebAssembly/Shared/data-binding/NestedGrandchild.razor"::: - -For an alternative approach suited to sharing data in memory and across components that aren't necessarily nested, see . - ## Additional resources * [Parameter change detection and additional guidance on Razor component rendering](xref:blazor/components/rendering)