Overview
The WPF app still wires services via static singletons (ConnectionManager, LoggingManager, AppLogger, etc.) and a custom DialogService.ServiceLocator. App.OnStartup mixes manual ServiceCollection setup with that locator, which makes mocking difficult and spreads lifetime management across the codebase.
Task
- Bootstrap the app with HostApplicationBuilder/GenericHost. Register all services (logging, device management, message consumers/producers, dialogs, EF context factory, view models).
- Convert singletons to regular classes with interfaces; register them with proper lifetimes.
- Remove the custom ServiceLocator once everything resolves through DI; update WPF windows/view models to request dependencies via constructor injection/factories.
- Update background workers/tasks to use injected dependencies instead of static Instance lookups.
- Adapt tests: build a minimal service provider and inject mocks/fakes.
- Update developer docs/README with new DI guidance.
Acceptance Criteria
- No static Instance/ServiceLocator usage remains in production code.
- All dependencies resolve through DI and can be overridden in tests.
- Build & tests pass; regression coverage includes ConnectionManager duplicate-device handling and LoggingManager session lifecycle with injected fakes.
- Documentation reflects the new startup/DI model.],
Overview
The WPF app still wires services via static singletons (ConnectionManager, LoggingManager, AppLogger, etc.) and a custom DialogService.ServiceLocator. App.OnStartup mixes manual ServiceCollection setup with that locator, which makes mocking difficult and spreads lifetime management across the codebase.
Task
Acceptance Criteria