diff --git a/aspnetcore/blazor/components/index.md b/aspnetcore/blazor/components/index.md index ca890673bb63..dd478a27a2cf 100644 --- a/aspnetcore/blazor/components/index.md +++ b/aspnetcore/blazor/components/index.md @@ -763,6 +763,9 @@ In the preceding example: * `NotifierService` invokes the component's `OnNotify` method outside of Blazor's synchronization context. `InvokeAsync` is used to switch to the correct context and queue a render. For more information, see . * The component implements . The `OnNotify` delegate is unsubscribed in the `Dispose` method, which is called by the framework when the component is disposed. For more information, see . +> [!IMPORTANT] +> If a Razor component defines an event that's triggered from a background thread, the component might be required to capture and restore the execution context () at the time the handler is registered. For more information, see [Calling `InvokeAsync(StateHasChanged)` causes page to fallback to default culture (dotnet/aspnetcore #28521)](https://github.com/dotnet/aspnetcore/issues/28521). + ## Use `@key` to control the preservation of elements and components When rendering a list of elements or components and the elements or components subsequently change, Blazor must decide which of the previous elements or components can be retained and how model objects should map to them. Normally, this process is automatic and can be ignored, but there are cases where you may want to control the process. @@ -2211,6 +2214,9 @@ In the preceding example: * `NotifierService` invokes the component's `OnNotify` method outside of Blazor's synchronization context. `InvokeAsync` is used to switch to the correct context and queue a render. For more information, see . * The component implements . The `OnNotify` delegate is unsubscribed in the `Dispose` method, which is called by the framework when the component is disposed. For more information, see . +> [!IMPORTANT] +> If a Razor component defines an event that's triggered from a background thread, the component might be required to capture and restore the execution context () at the time the handler is registered. For more information, see [Calling `InvokeAsync(StateHasChanged)` causes page to fallback to default culture (dotnet/aspnetcore #28521)](https://github.com/dotnet/aspnetcore/issues/28521). + ## Use `@key` to control the preservation of elements and components When rendering a list of elements or components and the elements or components subsequently change, Blazor must decide which of the previous elements or components can be retained and how model objects should map to them. Normally, this process is automatic and can be ignored, but there are cases where you may want to control the process. @@ -3211,6 +3217,9 @@ In the preceding example: * `NotifierService` invokes the component's `OnNotify` method outside of Blazor's synchronization context. `InvokeAsync` is used to switch to the correct context and queue a render. For more information, see . * The component implements . The `OnNotify` delegate is unsubscribed in the `Dispose` method, which is called by the framework when the component is disposed. For more information, see . +> [!IMPORTANT] +> If a Razor component defines an event that's triggered from a background thread, the component might be required to capture and restore the execution context () at the time the handler is registered. For more information, see [Calling `InvokeAsync(StateHasChanged)` causes page to fallback to default culture (dotnet/aspnetcore #28521)](https://github.com/dotnet/aspnetcore/issues/28521). + ## Use `@key` to control the preservation of elements and components When rendering a list of elements or components and the elements or components subsequently change, Blazor must decide which of the previous elements or components can be retained and how model objects should map to them. Normally, this process is automatic and can be ignored, but there are cases where you may want to control the process. @@ -4286,6 +4295,9 @@ In the preceding example: * `NotifierService` invokes the component's `OnNotify` method outside of Blazor's synchronization context. `InvokeAsync` is used to switch to the correct context and queue a render. For more information, see . * The component implements . The `OnNotify` delegate is unsubscribed in the `Dispose` method, which is called by the framework when the component is disposed. For more information, see . +> [!IMPORTANT] +> If a Razor component defines an event that's triggered from a background thread, the component might be required to capture and restore the execution context () at the time the handler is registered. For more information, see [Calling `InvokeAsync(StateHasChanged)` causes page to fallback to default culture (dotnet/aspnetcore #28521)](https://github.com/dotnet/aspnetcore/issues/28521). + ## Use `@key` to control the preservation of elements and components When rendering a list of elements or components and the elements or components subsequently change, Blazor must decide which of the previous elements or components can be retained and how model objects should map to them. Normally, this process is automatic and can be ignored, but there are cases where you may want to control the process. diff --git a/aspnetcore/blazor/globalization-localization.md b/aspnetcore/blazor/globalization-localization.md index 5b19d7c249f5..312a6bb28767 100644 --- a/aspnetcore/blazor/globalization-localization.md +++ b/aspnetcore/blazor/globalization-localization.md @@ -898,6 +898,7 @@ To further understand how the Blazor framework processes localization, see the [ * [Resources in .resx Files](/dotnet/framework/resources/working-with-resx-files-programmatically) * [Microsoft Multilingual App Toolkit](https://marketplace.visualstudio.com/items?itemName=MultilingualAppToolkit.MultilingualAppToolkit-18308) * [Localization & Generics](http://hishambinateya.com/localization-and-generics) +* [Calling `InvokeAsync(StateHasChanged)` causes page to fallback to default culture (dotnet/aspnetcore #28521)](https://github.com/dotnet/aspnetcore/issues/28521) :::moniker-end @@ -1776,6 +1777,7 @@ To further understand how the Blazor framework processes localization, see the [ * [Resources in .resx Files](/dotnet/framework/resources/working-with-resx-files-programmatically) * [Microsoft Multilingual App Toolkit](https://marketplace.visualstudio.com/items?itemName=MultilingualAppToolkit.MultilingualAppToolkit-18308) * [Localization & Generics](http://hishambinateya.com/localization-and-generics) +* [Calling `InvokeAsync(StateHasChanged)` causes page to fallback to default culture (dotnet/aspnetcore #28521)](https://github.com/dotnet/aspnetcore/issues/28521) :::moniker-end @@ -2555,6 +2557,7 @@ Optionally, add a menu item to the navigation in `Shared/NavMenu.razor` for the * [Resources in .resx Files](/dotnet/framework/resources/working-with-resx-files-programmatically) * [Microsoft Multilingual App Toolkit](https://marketplace.visualstudio.com/items?itemName=MultilingualAppToolkit.MultilingualAppToolkit-18308) * [Localization & Generics](http://hishambinateya.com/localization-and-generics) +* [Calling `InvokeAsync(StateHasChanged)` causes page to fallback to default culture (dotnet/aspnetcore #28521)](https://github.com/dotnet/aspnetcore/issues/28521) :::moniker-end @@ -3435,5 +3438,6 @@ To further understand how the Blazor framework processes localization, see the [ * [Resources in .resx Files](/dotnet/framework/resources/working-with-resx-files-programmatically) * [Microsoft Multilingual App Toolkit](https://marketplace.visualstudio.com/items?itemName=MultilingualAppToolkit.MultilingualAppToolkit-18308) * [Localization & Generics](http://hishambinateya.com/localization-and-generics) +* [Calling `InvokeAsync(StateHasChanged)` causes page to fallback to default culture (dotnet/aspnetcore #28521)](https://github.com/dotnet/aspnetcore/issues/28521) :::moniker-end