public void ResetToStartupView() { if (DataContext is ShellViewModel mainViewModel) { ClearWindowCollection(mainViewModel); ClearTabItems(mainViewModel); var localhostServer = mainViewModel.LocalhostServer; if (localhostServer.IsConnected && !Equals(mainViewModel.ActiveServer, localhostServer)) { mainViewModel.SetActiveServer(localhostServer.EnvironmentID); mainViewModel.SetActiveServer(localhostServer); } var explorerViewModel = mainViewModel.ExplorerViewModel; if (explorerViewModel != null) { DisconnectAllServers(localhostServer, explorerViewModel); } if (mainViewModel.ToolboxViewModel != null) { mainViewModel.ToolboxViewModel.SearchTerm = string.Empty; Toolbox.Activate(); Toolboxcontrol.Focus(); } } }
void OnLoaded(object sender, RoutedEventArgs e) { var xmlDocument = new XmlDocument(); if (_savedLayout != null) { try { xmlDocument.LoadXml(_savedLayout); } catch (Exception err) { File.Delete(FilePath); Dev2Logger.Error("Unable to load layout", GlobalConstants.WarewolfError); Dev2Logger.Error(err, GlobalConstants.WarewolfError); } } if (DataContext is ShellViewModel shellViewModel) { SetMenuExpanded(xmlDocument, shellViewModel); SetMenuPanelOpen(xmlDocument, shellViewModel); SetMenuPanelLockedOpen(xmlDocument, shellViewModel); } Toolbox.Activate(); Toolboxcontrol.Focus(); }
void OnLoaded(object sender, RoutedEventArgs e) { var xmlDocument = new XmlDocument(); if (_savedLayout != null) { xmlDocument.LoadXml(_savedLayout); } if (DataContext is ShellViewModel shellViewModel) { SetMenuExpanded(xmlDocument, shellViewModel); SetMenuPanelOpen(xmlDocument, shellViewModel); SetMenuPanelLockedOpen(xmlDocument, shellViewModel); } Toolbox.Activate(); Toolboxcontrol.Focus(); }