Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

NavigationPage as a child of a TabbedPage in XAML

$
0
0

I am trying to find a way to add a NavigationPage be a child of a TabbedPage in XAML. Adding xaml for NavigationPage doesn't work for me.
In my code, GetMainPage() returned page is a TabbedPage XAML, and it has children, which are also described in XAML, how can I insert a NavigationPage programmatically in between the XAML?

Following is my code:

<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
   <ContentPage x:Name="FirstTab" Title="Music">
      <StackLayout Padding="5, 25">
          ...
      </StackLayout>
   </ContentPage>-->
   <ContentPage x:Name="SecondTab" Title="Videos">
      <StackLayout Padding="5, 25">
          ...
      </StackLayout>
   </ContentPage>-->
   <ContentPage x:Name="ThirdTab" Title="Movies">
      <StackLayout Padding="5, 25">
          ...
      </StackLayout>
   </ContentPage>-->
</TabbedPage>

And in App.cs

public App()
{
        // The root page of your application
        MainPage = new NavigationPage(new TabbedMainPage());
}

Viewing all articles
Browse latest Browse all 58056

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>