Add fully-injected MainWindowViewModel constructor

Introduce an injected constructor taking IHardwareMonitorService, ILogger,
IRemoteWebServer (+ the concrete selection/plot/startup services) and
IStartupTracer, with shared settings initialization. A transitional 2-arg
constructor still builds the legacy graph for MainWindow until it is
DI-resolved; an _ownsServices flag keeps disposal correct across both paths.

Break the VM<->RemoteWebServer construction cycle by moving the root provider
to RemoteWebServer.SetRootProvider (removing it from the constructor), and make
RemoteWebServer.Quit idempotent. Update RemoteWebServer tests for the new ctor.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-06-02 15:09:12 -05:00
co-authored by Copilot
parent 50a07d5ce9
commit 594429bb7d
4 changed files with 60 additions and 17 deletions
@@ -24,6 +24,8 @@ public interface IRemoteWebServer : IDisposable
string UserName { get; set; }
void SetRootProvider(Func<ViewModels.SensorTreeItemViewModel?> rootProvider);
void SetPassword(string plainPassword);
bool Start();