public XShellModule(MainWindow window) { _container = new Container(); var persistenceService = new PersistenceService(); var menuManager = new DefaultMenuManager(window.MainMenu); var screenManager = new WindowAvalonDockScreenManager( window, window.MainPane, (p1, p2) => _container.Register(p1, p2, setup: Setup.With(allowDisposableTransient: true)), _container.Resolve, menuManager, persistenceService); _container.RegisterInstance <IPersistenceService>(persistenceService); _container.RegisterInstance <IMenuManager>(menuManager); _container.RegisterInstance <IScreenContainer>(screenManager); _container.RegisterInstance <IScreenManager>(screenManager); _container.Register <IViewBox, ViewBox>(); _container.Register <IUiDispatcher, UiDispatcher>(Reuse.Singleton); _container.Register <IBackgroundTaskManager, BackgroundTaskManager>(Reuse.Singleton); _container.RegisterInstance(new StatusBarManager(window.BackgroundWorkerView, _container.Resolve <IBackgroundTaskManager>())); RegisterServices(_container); RegisterScreens(screenManager); window.Closed += OnClosed; }
public MainWindow() { InitializeComponent(); container = new Container(); var persistenceService = new PersistenceService(); var menuManager = new DefaultMenuManager(MainMenu); var screenManager = new WindowAvalonDockScreenManager( this, MainPane, (p1, p2) => container.Register(p1, p2, setup: Setup.With(allowDisposableTransient: true)), container.Resolve, menuManager, persistenceService); container.RegisterInstance <IPersistenceService>(persistenceService); container.RegisterInstance <IMenuManager>(menuManager); container.RegisterInstance <IScreenContainer>(screenManager); container.RegisterInstance <IScreenManager>(screenManager); container.Register <IUiDispatcher, UiDispatcher>(Reuse.Singleton); container.Register <IBackgroundTaskManager, BackgroundTaskManager>(Reuse.Singleton); container.RegisterInstance(new StatusBarManager(BackgroundWorkerView, container.Resolve <IBackgroundTaskManager>())); RegisterServices(container); RegisterScreens(screenManager); }