Blazor
A web application, for displaying the sensor data in a browser. .NET supports two Blazor project types: Blazor Server (runs on the server) and Blazor WebAssembly (runs in the browser). We'll be using the Server type.
Create the Project
https://github.com/jfcarr/dotnet-iot-tui/tree/main/src/BlazorClient
Steps:
- Create the project, using
blazorserveras the project type. - Add a project reference to
SenseHatLib.csproj - App settings:
- Copy the
appsettings.default.jsonfile toappsettings.json, and update the setting values. - Add appsettings content entry to the .csproj file.
- Copy the
- Sensor page:
- Add a new
Sensor.razorpage. - Add a code-behind file for the page:
Sensor.razor.cs. - Implement code details.
- Update
NavMenu.razorto include the new Sensor page.
- Add a new