I'm developing a large WPF application and most of the functionality resides in just one window. I use Autofac for DI and I try to keep to the MVVM pattern. I used a ViewModel, until one wasn't enough. I then separated into a number of ViewModels. Then helper objects appeared, new windows to which I tied events, and so forth.
My MainWindow now has a constructor that looks something like this:
public MainWindow(
IConnectionViewModel connectionViewModel,
IFilterViewModel filterViewModel,
IAnotherViewModel anotherViewModel,
IPipeline pipeline,
IWorkingScreens workingScreens,
IClientSideConnectionManager clientSideConnectionManager,
IYetAnotherViewModel yetAnotherViewModel,
IDialogViewModel dialogViewModel,
IDialogViewModel2 dialogViewModel2,
IDetailWindow detailWindow,
IAnotherWindow anotherWindow,
IApplicationController applicationController
)
: base(workingScreens)
What is perhaps worse is that this file is over 300 lines long! Before I add yet another dependency to this monstrosity, can someone give me an idea of what refactoring needs to be done? What abstraction(s) am I missing?