Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generic GoBack and remove legacy GoBackTo #3101

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

berhir
Copy link
Contributor

@berhir berhir commented Mar 8, 2024

Description of Change

With #2818 the behavior of GoBack was extended to support navigating back to a specific viewName in the stack.
But there is currently no generic version of GoBack in the NavigationBuilder.

This PR adds the generic GoBack<TViewModel>() to the NavigationBuilder.

As suggested by dansiegel I have removed the legacy GoBackTo<TViewModel>() instead of marking it as obsolete.

The old GoBackTo worked differently and popped each page and called CanNavigateAsync, OnNavigatedFrom, and OnNavigatedTo of each page. Maybe there are cases when this is the desired behavior. So if you want to keep the old behavior, I suggest giving this methods a clear name to easily distinguish GoBack and GoBackTo. Just let me know and I can update the PR.

Bugs Fixed

None

API Changes

List all API changes here (or just put None), example:

Added:

  • Task INavigationBuilder.GoBackAsync();

Removed:

  • Task PageNavigationService.GoBackToAsync(string name, INavigationParameters parameters) calls GoBackAsync(name, parameters)
  • Task INavigationServiceExtensions.GoBackToAsync(this INavigationService navigationService, string name)
  • Task INavigationBuilder.GoBackTo(INavigationParameters parameters);
  • Task NavigationBuilderExtensions.GoBackTo(this INavigationBuilder builder)

Behavioral Changes

GoBackTo was removed and GoBack works without calling CanNavigateAsync, OnNavigatedFrom, and OnNavigatedTo of each page.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard

@berhir berhir marked this pull request as ready for review March 21, 2024 08:53
@dansiegel dansiegel merged commit 2a25770 into PrismLibrary:master Mar 26, 2024
2 checks passed
@dansiegel
Copy link
Member

Thanks for the PR

@dansiegel dansiegel mentioned this pull request Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants