/// <summary> /// Bring back to Inspect StartUp /// </summary> internal void HandleBackToLiveFromEventPage() { StartInspectMode(InspectView.Live); HighlightAction.GetInstance(AccessibilityInsights.Actions.Enums.HighlighterType.Selected).Clear(); HighlightAction.GetDefaultInstance().IsEnabled = ConfigurationManager.GetDefaultInstance().AppConfig.IsHighlighterOn; UpdateMainWindowUI(); }
/// <summary> /// Bring app back to selecting State /// </summary> public void HandleBackToSelectingState() { // if coming from startup, restore left nav bar if (this.CurrentPage == AppPage.Start) { this.bdLeftNav.IsEnabled = true; this.gdModes.Visibility = Visibility.Visible; this.btnPause.Visibility = Visibility.Visible; } // clear selected element highliter HighlightAction.GetInstance(AccessibilityInsights.Actions.Enums.HighlighterType.Selected).Clear(); HighlightImageAction.ClearDefaultInstance(); // this can be disabled if previous action was loading old data format. // bring it back to enabled state. this.btnHilighter.IsEnabled = true; // since we comes back to live mode, enable highlighter by default. SelectAction.GetDefaultInstance().ClearSelectedContext(); // turn highlighter on once you get back to selection mode. SetHighlightBtnState(true); var ha = HighlightAction.GetDefaultInstance(); ha.HighlighterMode = ConfigurationManager.GetDefaultInstance().AppConfig.HighlighterMode; ha.IsEnabled = true; ha.SetElement(null); /// make sure that all Mode UIs are clean since new selection will be done. CleanUpAllModeUIs(); if (this.CurrentPage == AppPage.Start || (this.CurrentPage == AppPage.CCA) || (this.CurrentPage == AppPage.Test) || (this.CurrentPage == AppPage.Inspect && this.CurrentView != InspectView.Live) || (this.CurrentPage == AppPage.Events) || (this.CurrentPage == AppPage.Inspect && SelectAction.GetDefaultInstance().IsPaused)) { SelectAction.GetDefaultInstance().Scope = ConfigurationManager.GetDefaultInstance().AppConfig.IsUnderElementScope ? AccessibilityInsights.Actions.Enums.SelectionScope.Element : AccessibilityInsights.Actions.Enums.SelectionScope.App; cbSelectionScope.SelectedIndex = (SelectAction.GetDefaultInstance().Scope == AccessibilityInsights.Actions.Enums.SelectionScope.Element) ? 0 : 1; StartInspectMode(InspectView.Live); // clean up data when we get back to selection mode. this.CurrentPage = AppPage.Inspect; this.CurrentView = InspectView.Live; } // garbage collection for any UI elements GC.Collect(); // enable element selector EnableElementSelector(); // if it was open when the switch back button is clicked. HideConfigurationMode(); UpdateMainWindowUI(); }