var tabbedPage = new TrialTabbedPage();
tabbedPage.BindingContext = new TrailTabViewModel(_originLatitud, _originLongitud, mile);
await Navigation.PushAsync(tabbedPage);
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:d="http://xamarin.com/schemas/2014/forms/design" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="CureittApp.Views.TrialTabbedPage" xmlns:local="clr-namespace:CureittApp.Views"> <local:AdvancedTrailPage Title="List" BindingContext="{Binding TrailViewTab}"/> <local:TrailMapViewPage Title="Map" BindingContext="{Binding TrailViewTab}"/> </TabbedPage>
~~~~
public class TrailTabViewModel
{
public AdvancedTrailModel TrailViewTab { get; set; }
public TrailTabViewModel(double latitude, double longitude, double mile)
{
TrailViewTab = new AdvancedTrailModel(latitude, longitude, mile, Navigation);
}
}
await Navigation.PopAsync();
Answers
Where did you call
Navigation.PopAsync();
?We usually set the Tabbed Page as the root main page and won't use a navigation page wrap the tabbed page.
You can try to use
Navigation.PushModalAsync(Page page)
to present a tabbed page and useNavigation.PopModalAsync()
to dismiss.If you do want to use the navigation stack architecture try to post the sample here to help us reproduce the issue.
> Where did you call Navigation.PopAsync();?
> We usually set the Tabbed Page as the root main page and won't use a navigation page wrap the tabbed page.
> You can try to use Navigation.PushModalAsync(Page page) to present a tabbed page and use Navigation.PopModalAsync() to dismiss.
> If you do want to use the navigation stack architecture try to post the sample here to help us reproduce the issue.
I called the Tabbed Page inside a navigation page, from a cs file. That cs file binded to a viewmodel page. From viewmodel I tried to pop that tabbed page.
If I use PushModalAsync do I get the back button on navigation bar?
You need to share your sample to help us understand this logic.
No. But you should create the navigation pages for each item in the tabbed page like:

So that each item could have its own navigation bar.
I already shared my code above
in my App.cs
MainPage = new MainPage();
inside MainPage (which is a MasterDetail Page)
Detail = new NavigationPage((Page)Activator.CreateInstance(item.TargetType));
in Default Detail Page(A button click navigates to following Page)
await Navigation.PushAsync(new MapSearchPage());
inside MapSearchPage(A button click navigates to a Tabbed Page)
var tabbedPage = new TrialTabbedPage();
tabbedPage.BindingContext = new TrailTabViewModel(_originLatitud, _originLongitud, mile);
await Navigation.PushAsync(tabbedPage);
…………… then follows rest of above code> @Richy said:
We can't use the code to reproduce your issue. You need to share an entire small sample so that I can run it to see the error you are facing.