I'm kind new on Xamarin Forms and I'm having trouble to figure out what the problem is with the Navigation between pages. I already read a bunch of articles from Xamarin docs, e.g. Xamarin Navigation Docs and people having similar problems but I haven't figure out yet.
So, I'm having the following error: "PushAsync is not supported globally on iOS, please use a NavigationPage."
I have a login page and if login is successful then I navigate to a Menu page. I have a button in that page that would lead to another page but when it is clicked the error is raised.
Code:
On App.cs I have defined:
MainPage = new MainPage();
This "MainPage" is the login page. After login is successful the following code is executed:
App.Current.MainPage = new MenuPage();
The "MenuPage" is shown. When I click a button it should navigate to another page:
async void Bt_Photo_Clicked(System.Object sender, System.EventArgs e)
{
await Navigation.PushAsync(new PhotoPage());
}
I tried several variations but no success, like for instance not calling async the new "PhotoPage" but ya, not working also. Can anyone explain what am I doing wrong?
Thanks in advance
P.S. All pages are contentPages.