I have 2 pages in a Xamarin Forms application. On the first page there are 4 icons on the toolbar. My second page is the login page and has a check mark and a cross in the toolbar.
I canโt get the login page to show any badges unless I make it a navigation page. I also have to clear ToolBarItems on the first page before calling PushAsync (), otherwise it complains that there are too many toolbar elements.
If I call PopAsync () on the login page, it does not return to the first page. I assume this is due to the fact that they are 2 navigation pages. I also tried PopToRootAsync (). However, the back button works.
My question is: how to show different icons on two different pages in such a way that navigation can work?
I am testing this on Windows Phone 8.0
Here is the code that calls the login page:
private async void ShowLoginPage() { ToolbarItems.Clear(); var page = new NavigationPage(new LoginPage()); await Navigation.PushAsync(page); }
and here is the code to return to the first page:
private void Cancel() { Navigation.PopToRootAsync(); }
I am running Xamarin.Forms v1.2.2.6243
source share