Skip to content

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
@berhir berhir force-pushed the remove-legacy-gobackto branch from 25c5176 to acee603 Compare March 26, 2024 08:01
@dansiegel dansiegel merged commit 2a25770 into PrismLibrary:master Mar 26, 2024
@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.

2 participants