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?