A
A
Andrey2018-11-06 00:03:34
C++ / C#
Andrey, 2018-11-06 00:03:34

Xamarin Forms how to make navigation on three or more pages?

Good afternoon!
Please tell me, the architecture of the application on Xamarin Forms is such that the user sequentially navigates from one page to another.
With the opening of the first page, there were no special problems.
In App.xaml.cs added And from the main page MainPage.xaml.cs the user goes to the list page. Everything is fine here. No problem.
MainPage = new NavigationPage(new MainPage());

App.Current.MainPage = new Page1(); // без навигации

or
await Navigation.PushAsync(new Page1()); // с навигацией

or because further, when selecting a position from the list, the following window should open:
await Navigation.PushAsync(new Page2(e.SelectedItem.ToString()));

But, I get this error:
System.InvalidOperationException: PushAsync is not supported globally on Android, please use a NavigationPage.
:( I
re-read a bunch of solutions, tried it, but without much success.
Maybe I didn’t take into account something?
I would be very happy with the advice!
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
relov, 2020-09-04
@andrey71

App.cs further navigation is carried out as follows: You can read more in the dock https://docs.microsoft.com/ru-ru/xamarin/xamarin-f... PS, I recommend that you also familiarize yourself with Shell, which also allows you to navigate https://docs.microsoft.com/en-us/xamarin/xamarin-f...
MainPage = new NavigationPage(new MainPage());
await Navigation.PushAsync(new Page1());

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question