Looking at the template
When running the project, we should recognize the UI. It is the same Hello, world! page, the same counter, and the same weather forecast.
If we take a look in the Pages
folder, we’ll find the Razor components, and if we open the Counter.razor
file, we will find a familiar component that looks like this:
@page "/counter"
<h1>Counter</h1>
<p role="status">Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount++;
}
}
To create a Blazor Hybrid app, adding components like this is what you need to know to get started, but let’s dig a bit deeper. The template is .NET MAUI App with some added Blazor startup code.
To understand what is happening, we will start in the Platforms
folder. In the platforms
folder...