From 5c370db17069a67067fb3ef0de85ae88aa957d31 Mon Sep 17 00:00:00 2001 From: Robert Haken Date: Thu, 5 Sep 2024 17:14:03 +0200 Subject: [PATCH] What's new .NET 9 - Blazor constructor injection sample (#33538) --- aspnetcore/release-notes/aspnetcore-9/includes/blazor.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aspnetcore/release-notes/aspnetcore-9/includes/blazor.md b/aspnetcore/release-notes/aspnetcore-9/includes/blazor.md index a3f710ab38..cbfeb3a349 100644 --- a/aspnetcore/release-notes/aspnetcore-9/includes/blazor.md +++ b/aspnetcore/release-notes/aspnetcore-9/includes/blazor.md @@ -148,7 +148,10 @@ In the following example, the partial (code-behind) class injects the `Navigatio ```csharp public partial class ConstructorInjection(NavigationManager navigation) { - protected NavigationManager Navigation { get; } = navigation; + private void HandleClick() + { + navigation.NavigateTo("/counter"); + } } ```