Severity: Warning
File: src/Servy.Manager/Views/MainWindow.xaml.cs
Lines: 48–109
Description:
CreateMainViewModel() is a 60-line composition root inside the View's code-behind. It hardwires the entire dependency graph: AppDbContext, DapperExecutor, ProtectedKeyProvider, SecureData, ServiceRepository, ServiceManager, FileDialogService, MessageBoxService, HelpService, and more. The View knows about infrastructure types (AppDbContext, DapperExecutor, SQLiteDbInitializer) that have no business in a UI layer. Replacing any dependency requires modifying the View. The same pattern exists in Servy/Views/MainWindow.xaml.cs.
Suggested fix:
Move composition to App.xaml.cs or a dedicated Bootstrapper/DI container. The Window should receive a pre-built MainViewModel, not build it.
Severity: Warning
File:
src/Servy.Manager/Views/MainWindow.xaml.csLines: 48–109
Description:
CreateMainViewModel()is a 60-line composition root inside the View's code-behind. It hardwires the entire dependency graph:AppDbContext,DapperExecutor,ProtectedKeyProvider,SecureData,ServiceRepository,ServiceManager,FileDialogService,MessageBoxService,HelpService, and more. The View knows about infrastructure types (AppDbContext,DapperExecutor,SQLiteDbInitializer) that have no business in a UI layer. Replacing any dependency requires modifying the View. The same pattern exists inServy/Views/MainWindow.xaml.cs.Suggested fix:
Move composition to
App.xaml.csor a dedicatedBootstrapper/DI container. The Window should receive a pre-builtMainViewModel, not build it.