Skip to content

Commit

Permalink
DYN-6493: reset page order when discarding publish package form (#14695)
Browse files Browse the repository at this point in the history
* reset page order

- goes back to the first page when navigating away from the tab (on cancel only)

* revert namespaces

* revert namespaces
  • Loading branch information
dnenov authored Dec 6, 2023
1 parent 3dbe2e1 commit 0450cc0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,5 +329,21 @@ private void CancelButton_Click(object sender, RoutedEventArgs e)
PublishPackageViewModel.CancelCommand.Execute();
}
}

/// <summary>
/// Navigates back to the starting page
/// </summary>
internal void ResetPageOrder()
{
currentPage = 0;
int stepIndex = Breadcrumbs.IndexOf((string)PublishPages[0].Tag);
for (int i = Breadcrumbs.Count - 1; i > stepIndex; i--)
{
Breadcrumbs.RemoveAt(i);
}
this.mainFrame.NavigationService.Navigate(PublishPages[currentPage]);
this.breadcrumbsNavigation.Visibility = Visibility.Collapsed;
ToggleButtonRowVisibility(0);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,11 @@ private void tab_PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
PackageManagerViewModel.PublishPackageViewModel.CancelCommand.Execute();
selectedTab.IsSelected = true;
var pmPublishControl = this.packageManagerPublish as PackageManagerPublishControl;
if (pmPublishControl != null)
{
pmPublishControl.ResetPageOrder();
}
}
else
{
Expand Down

0 comments on commit 0450cc0

Please sign in to comment.