Beispiel #1
0
        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();
                }
            }
        }
Beispiel #2
0
        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();
        }
Beispiel #3
0
        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();
        }