Last post Sep 02, 2020 05:27 AM by Mikesdotnetting
Sep 01, 2020 08:39 PM|Jim Young|LINK
I'm studying Blazor architecture, looking at the sample program that get created by default. I understand that in the MainLayout.razor file the @Body property determines what get rendered in the layout. By default this is Index.razor. What I can't figure
out is how this property is set. I can't find any where in the project where the Body property value is defined.
Sep 02, 2020 05:27 AM|Mikesdotnetting|LINK
It's defined in LayoutComponentBase: https://github.com/dotnet/aspnetcore/blob/master/src/Components/Components/src/LayoutComponentBase.cs.
It's a RenderFragment parameter. This section of the docs explains how RenderFragment parameters work in template components like the Layout component: https://docs.microsoft.com/en-us/aspnet/core/blazor/components/templated-components?view=aspnetcore-3.1#template-parameters