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

[Enhancement] NavigateFrom #3118

Open
dansiegel opened this issue Apr 3, 2024 · 0 comments
Open

[Enhancement] NavigateFrom #3118

dansiegel opened this issue Apr 3, 2024 · 0 comments

Comments

@dansiegel
Copy link
Member

Summary

You may find a scenario in which you may have a navigation stack like FlyoutPage/NavigationPage/ViewA/ViewB/ViewC/etc where the ViewModel's share a common shared base class that should be able to define a navigation event. The issue would be that you don't actually know how far back you need to navigate which makes it impractical to do ../../SomePage. For these scenarios we should add a NavigateFromAsync method which takes 2 arguments:

  1. The Name of the View we want to navigate from
  2. The route to navigate from that View

This API should then effectively do the same as ../../SomePage where the ../.. is replaced by going back until we found the View that was specified.

API Changes

public interface INavigationService
{
    Task<INavigationResult> NavigateFromAsync(string viewName, Uri uri, INavigationParameters parameters);
}
@dansiegel dansiegel added this to the vNext milestone Apr 3, 2024
@dansiegel dansiegel self-assigned this Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant