0
votes

I'm trying to implement a login flow (firstly showing the LoginPage) and the Login Page has a Command that the user can click to create an account (this is a NavigationPage), so the flow is LoginPage -> NewAccountPage (with button bar to navigate back to LoginPage).

In App.xaml.cs I have:
NavigationService.NavigateASync("LoginPage");  //I'm not sure if the LoginPage should be in NavigationStack, maybe be presented in Modal way

In LoginPageViewModel, I have a Command that simply call

_navigationService.NavigateAsync("NewAccountPage");

When the user press this button to create an account, the NewAccountPage is properly called but I get an error when the code flow finish to call the NavigationAsync("NewAccountPage");

The error is something like this :

Unhandled Exception:System.InvalidOperationException: Sequence contains no elements ocurred

I have no idea how to handle with this, could someone review if I'm making any mistake?

2
unfortunately, there is not enough information to help. Also you have conflicting information in your description as you are not using a NavigationPage anywhere, but you say you are. Please clarify your issue and provide much more detail.user5420778

2 Answers

1
votes

This has been answered on your other post on the Xamarin.Forms forum:

https://forums.xamarin.com/discussion/97823/prism-and-navigation

0
votes
 NavigationService.NavigateAsync("/MasterDetailsPage/NavigationPage/MainPage");