Resolving windows in Structure Map or how to manage multiple windows in WPF MVVM?
问题 I have been reading Mark Seeman's book on dependency injection in .NET and I'm struggling to configure composition root in WPF application. My container will be registered in the application startup method: protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var container = new Container(); container.Configure(r => { r.For<IAccountServices>().Use<AccountServicesProxy>(); r.For<MainWindow>().Use<MainWindow>(); }); } This makes sense as the application startup represents