public MainWindowViewModel(ILifetimeScope lifetimeScope, Dispatcher dispatcher, AppConfig config) : base(lifetimeScope, dispatcher) { _config = config; SetupBuilderView = this.RegisterModel <SetupBuilderViewModel>(nameof(SetupBuilderView), "Setup-Builder"); NodeView = this.RegisterModel <NodeViewModel>(nameof(NodeView), "Node-View"); SeedView = this.RegisterModel <SeedNodeViewModel>(nameof(SeedView), "Seed-View"); HostView = this.RegisterModel <HostViewModel>(nameof(HostView), "Host-View"); ApplicationsView = this.RegisterModel <ApplicationsViewModel>(nameof(ApplicationsView), "Applications-View"); ConfigurationView = this.RegisterModel <ConfigurationViewModel>(nameof(ConfigurationView), "Configuration-View"); AppInfo = this.RegisterImport <CommonAppInfo>(nameof(AppInfo)); Receive <StartInitialHostSetup>(_ => UICall(() => _dockingManager.ActivateWindow("SetupBuilder"))); Receive <DisplayApplications>(_ => UICall(() => _dockingManager.ActivateWindow("ApplicationsView"))); }
/// <summary> /// Set the active window /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnActivateWindow(object sender, RoutedEventArgs e) { string name = (sender as MenuItem).Tag as string; DockingManager.ActivateWindow(name); }