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
blazorserver
as the project type. - Add a project reference to
SenseHatLib.csproj
- App settings:
- Copy the
appsettings.default.json
file toappsettings.json
, and update the setting values. - Add appsettings content entry to the .csproj file.
- Copy the
- Sensor page:
- Add a new
Sensor.razor
page. - Add a code-behind file for the page:
Sensor.razor.cs
. - Implement code details.
- Update
NavMenu.razor
to include the new Sensor page.
- Add a new