What is this? A small desktop reference app that demonstrates a basic meter calibration workflow and modern .NET desktop patterns: WPF + MVVM, Entity Framework Core, dependency injection with HostBuilder, and xUnit tests.
Why? To provide a clear, reproducible example of a calibration UI and data model that compiles, runs, and is easy to extend — useful as portfolio material or as a learning scaffold.
Stack: .NET 8, WPF (MVVM with CommunityToolkit.Mvvm), EF Core (InMemory by default; SQL Server optional), xUnit, VS Code.
CI: Azure DevOps sample pipeline included.
- Install .NET SDK 8.x.
- Open this folder in VS Code.
- Build and run:
dotnet build dotnet run --project src/MeterCalibDesk.UI
- Run tests:
dotnet test
- WPF + MVVM
- Commands for Add Meter, Start Calibration, Progress, Finish (Pass/Fail)
- Data binding to lists and a progress bar
- EF Core
- InMemory provider (zero‑setup) and optional SQL Server/LocalDB
- Dependency Injection
HostBuilderwith DI for view models and repositories
- Testing
xUnittest that adds a meter, starts a run, updates progress, and finishes
- DevOps
- Azure DevOps pipeline (
azure-pipelines.yml) for restore → build → test → publish
- Azure DevOps pipeline (
There is no physical bench in this demo. Start Calibration creates a CalibrationRun record and sets the selected meter’s status to Calibrating. Simulate 50% writes Progress=50 on the run. Finish closes the run (Pass/Fail), sets the meter back to Idle, and shows 100% in the progress bar. The aim is to show UI flow + data updates, not real hardware I/O.
Edit src/MeterCalibDesk.UI/appsettings.json → set "UseInMemoryDatabase": false and provide a SQL Server/LocalDB connection string:
{
"Database": {
"UseInMemoryDatabase": false,
"SqlServer": {
"ConnectionString": "Server=(localdb)\\MSSQLLocalDB;Database=MeterCalibDesk;Trusted_Connection=True;MultipleActiveResultSets=true;TrustServerCertificate=True"
}
}
}The demo uses EnsureCreated() to bootstrap schema.
MeterCalibDesk/
├─ src/
│ ├─ MeterCalibDesk.UI/ # WPF app (MVVM, DI, HostBuilder)
│ └─ MeterCalibDesk.Data/ # EF Core entities + repositories
├─ tests/
│ └─ MeterCalibDesk.Tests/ # xUnit tests (InMemory)
├─ .vscode/ # launch/tasks (VS Code)
├─ azure-pipelines.yml # Azure DevOps CI sample
└─ README.md
- Build and test logs (e.g.,
evidence/build.log,evidence/test.log,Tests.trx) - Published binaries (e.g.,
evidence/publish/) + hash (exe_sha256.txt) - One screenshot of the Meters screen with the bottom toolbar
dotnet --infosaved asevidence/dotnet_info.txt
- Calibration parameters & result details
- Run history table with filtering
- EF Core Migrations for SQL Server
- Logging/telemetry (Serilog), exception handling
- Integration tests (SQL) and ViewModel tests
- Optional TFS/Azure DevOps Server boards build; GitHub Actions workflow
MIT – see LICENSE.