diff --git a/aspnetcore/blazor/hybrid/tutorials/windows-forms.md b/aspnetcore/blazor/hybrid/tutorials/windows-forms.md index c5af60765a..ba35c1161b 100644 --- a/aspnetcore/blazor/hybrid/tutorials/windows-forms.md +++ b/aspnetcore/blazor/hybrid/tutorials/windows-forms.md @@ -221,7 +221,7 @@ using Microsoft.AspNetCore.Components.WebView.WindowsForms; using Microsoft.Extensions.DependencyInjection; ``` -Inside the `Form1` constructor, after the `InitializeComponent()` method call, add the following code: +Inside the `Form1` constructor, after the `InitializeComponent` method call, add the following code: ```csharp var services = new ServiceCollection(); @@ -231,6 +231,9 @@ blazorWebView1.Services = services.BuildServiceProvider(); blazorWebView1.RootComponents.Add("#app"); ``` +> [!NOTE] +> The `InitializeComponent` method is generated by a source generator at app build time and added to the compilation object for the calling class. + The final, complete C# code of `Form1.cs`: ```csharp diff --git a/aspnetcore/blazor/hybrid/tutorials/wpf.md b/aspnetcore/blazor/hybrid/tutorials/wpf.md index b17ace9b3f..509dec852c 100644 --- a/aspnetcore/blazor/hybrid/tutorials/wpf.md +++ b/aspnetcore/blazor/hybrid/tutorials/wpf.md @@ -234,7 +234,7 @@ Add the namespace [!NOTE] +> The `InitializeComponent` method is generated by a source generator at app build time and added to the compilation object for the calling class. + The final, complete C# code of `MainWindow.xaml.cs`: ```csharp