From 07db5f4f67d422cbd61923207f5e2f90aa672487 Mon Sep 17 00:00:00 2001 From: jesusalvino <96534278+jesusalvino@users.noreply.github.com> Date: Fri, 10 Mar 2023 14:02:57 -0500 Subject: [PATCH] Tours buttons behavior (#13808) * Tours buttons behavior * Disabling Toolbar Buttons on the GuidesManager --- src/DynamoCoreWpf/UI/GuidedTour/GuidesManager.cs | 8 ++++---- src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/DynamoCoreWpf/UI/GuidedTour/GuidesManager.cs b/src/DynamoCoreWpf/UI/GuidedTour/GuidesManager.cs index 48894f07894..3bdb9973e0b 100644 --- a/src/DynamoCoreWpf/UI/GuidedTour/GuidesManager.cs +++ b/src/DynamoCoreWpf/UI/GuidedTour/GuidesManager.cs @@ -174,6 +174,7 @@ internal void LaunchTour(string tourName) { Initialize(); GuideFlowEvents.OnGuidedTourStart(tourName); + dynamoViewModel.OnEnableShortcutBarItems(false); Logging.Analytics.TrackScreenView("InteractiveGuidedTours"); Logging.Analytics.TrackEvent(Logging.Actions.Start, Logging.Categories.GuidedTourOperations, Resources.ResourceManager.GetString(currentGuide.GuideNameResource, System.Globalization.CultureInfo.InvariantCulture).Replace("_", ""), currentGuide.SequenceOrder); } @@ -230,7 +231,6 @@ private void TourFinished(GuidedTourStateEventArgs args) /// internal void ExitTour() { - if (currentGuide != null) { foreach (Step tmpStep in currentGuide.GuideSteps) @@ -259,12 +259,13 @@ internal void ExitTour() exitGuideWindow.ContinueTourButton.Click -= ContinueTourButton_Click; } + dynamoViewModel.OnEnableShortcutBarItems(true); + //Hide guide background overlay guideBackgroundElement.Visibility = Visibility.Hidden; GuidesValidationMethods.CurrentExecutingGuide = null; tourStarted = false; } - } /// @@ -523,8 +524,7 @@ internal Guide GetNextGuide() private void Popup_StepClosed(string name, Step.StepTypes stepType) - { - dynamoViewModel.OnEnableShortcutBarItems(true); + { GuideFlowEvents.OnGuidedTourFinish(currentGuide.Name); //The exit tour popup will be shown only when a popup (doesn't apply for survey) is closed or when the tour is closed. diff --git a/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs b/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs index 95234466e67..53251303f53 100644 --- a/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs +++ b/src/DynamoCoreWpf/Views/Core/DynamoView.xaml.cs @@ -2508,7 +2508,6 @@ private void ShowGetStartedGuidedTour() try { dynamoViewModel.MainGuideManager.LaunchTour(GuidesManager.GetStartedGuideName); - dynamoViewModel.OnEnableShortcutBarItems(false); } catch (Exception) { @@ -2526,7 +2525,7 @@ private void PackagesMenuGuide_Click(object sender, RoutedEventArgs e) { try { - dynamoViewModel.MainGuideManager.LaunchTour(GuidesManager.PackagesGuideName); + dynamoViewModel.MainGuideManager.LaunchTour(GuidesManager.PackagesGuideName); } catch (Exception) {