# Architecture & Technical Design – PulseDock ## Overview PulseDock is built on modern C# .NET 10 WPF architecture leveraging Dependency Injection, MVVM separation, and non-blocking background telemetry sampling. ``` ┌─────────────────────────┐ │ App Bootstrapper │ │ (Microsoft.Extensions │ │ .DependencyInjection) │ └────────────┬────────────┘ │ ┌───────────────────────┼───────────────────────┐ ▼ ▼ ▼ ┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐ │ Hardware │ │ Settings & │ │ Theme & Position │ │ Monitoring │ │ Notifications │ │ Management │ │ Service │ │ Services │ │ Services │ └────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘ │ │ │ └───────────────────────┼───────────────────────┘ ▼ ┌───────────────────────┐ │ MainWidgetViewModel │ └───────────┬───────────┘ ▼ ┌───────────────────────┐ │ MainWindow (WPF UI) │ │ Glassmorphism XAML │ └───────────────────────┘ ``` ## Key Architectural Principles 1. **Non-Blocking Telemetry Polling**: - `HardwareMonitoringService` executes hardware polling on background tasks via `PeriodicTimer` and `CancellationToken`. - Never blocks the WPF UI thread (`Dispatcher.InvokeAsync` marshals updates cleanly). 2. **Non-Elevated Safe Fallbacks**: - Standard user mode startup. - If `LibreHardwareMonitorLib` kernel driver access is denied without Admin rights, it automatically falls back to `PerformanceCounter`, WMI, `NetworkInterface`, and `System.Diagnostics` without crashing. 3. **Memory Optimization**: - `CircularBuffer` allocates fixed-size arrays for 60s/300s/900s history arrays. - Zero endless GC allocations during long runtime sessions. 4. **Custom WPF Drawing Controls**: - `SparklineControl` and `ProgressRingControl` derive directly from `FrameworkElement` using `DrawingContext`, bypassing heavy WPF layout trees for rendering.