title: Tabbed Page Inside Master Detail Page Xamarin
body: <p>I am trying to add a tabbed page as shown in the xamarin documentation but I keep getting the following error, System.NullReferenceException "Object reference not set to an instance of an object." Do I need to declare a new object for each page or is this done automatically when using xaml?</p>
  
  <p>Here is my StackTrace,</p>
  
  <pre><code>  at Xamarin.Forms.Platform.Android.AppCompat.Platform.LayoutRootPage(Xamarin.Forms.P age page, Int32 width, Int32 height) [0x0005d] in   C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\AppCompat\Plat form.cs:279 
    at Xamarin.Forms.Platform.Android.AppCompat.Platform.Xamarin.Forms.Platform.Android.IPlatformLayout.OnLayout (Boolean changed, Int32 l, Int32 t, Int32 r, Int32 b) [0x00003] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:196 
    at Xamarin.Forms.Platform.Android.PlatformRenderer.OnLayout (Boolean changed, Int32 l, Int32 t, Int32 r, Int32 b) [0x0000e] in C:\BuildAgent\work\aad494dc9bc9783\Xamarin.Forms.Platform.Android\PlatformRenderer.cs:73 
    at Android.Views.ViewGroup.n_OnLayout_ZIIII (IntPtr jnienv, IntPtr native__this, Boolean changed, Int32 l, Int32 t, Int32 r, Int32 b) [0x00009] in /Users/builder/data/lanes/3415/7db2aac3/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Views.ViewGroup.cs:3427 
    at (wrapper dynamic-method) System.Object:d59f31f1-b9b6-40ea-9254-a422fe409750 (intptr,intptr,bool,int,int,int,int)
  </code></pre>
  
  <p>Here is my code,</p>
  
  <pre><code>using Xamarin.Forms;
  namespace BSi.Mobile.Events.Views
  {
      public partial class MainMasterDetailPage : MasterDetailPage
      {
          public MainMasterDetailPage()
          {
              InitializeComponent();
          }
      }
  }
  
  &lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;MasterDetailPage xmlns="http://xamarin.com/schemas/2014/forms"
                xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                xmlns:prism="clr-namespace:Prism.Mvvm;assembly=Prism.Forms"
                xmlns:local="clr-namespace:BSi.Mobile.Events.Views;assembly=BSi.Mobile.Events"
                prism:ViewModelLocator.AutowireViewModel="True"
                x:Class="BSi.Mobile.Events.Views.MainMasterDetailPage"&gt;
      &lt;MasterDetailPage.Master&gt;
         &lt;ContentPage Title="Default" Padding="10"&gt;
            &lt;StackLayout&gt;
               &lt;Button Text="Home" Command="{Binding MenuSelectedCommand}"  CommandParameter="NavigationPage\MainPage"/&gt;
               &lt;Button Text="Event Schedule" Command="{Binding MenuSelectedCommand}" CommandParameter="NavigationPage\EventPage"/&gt;
               &lt;Button Text="Floor Plan" Command="{Binding MenuSelectedCommand}" CommandParameter="NavigationPage\FloorPlanPage"/&gt;
               &lt;Button Text="Sponsor/Media Partners" Command="{Binding MenuSelectedCommand}" CommandParameter="NavigationPage\SponsorsPage"/&gt;
               &lt;Button Text="Where To Eat" Command="{Binding MenuSelectedCommand}" CommandParameter="NavigationPage\FoodNearbyPage"/&gt;
            &lt;/StackLayout&gt;
         &lt;/ContentPage&gt;
     &lt;/MasterDetailPage.Master&gt;
     &lt;MasterDetailPage.Detail&gt;
         &lt;TabbedPage&gt;
             &lt;TabbedPage.Children&gt;
                &lt;local:MainPage Title="Info" Icon="http://icons.iconarchive.com/icons/graphicloads/100-flat/256/home-icon.png"/&gt;
                &lt;local:EventPage Title="Sessions" Icon="http://icons.iconarchive.com/icons/graphicloads/100-flat/256/home-icon.png"/&gt;
                &lt;local:SpeakersPage Title="Speakers" Icon="http://icons.iconarchive.com/icons/graphicloads/100-flat/256/home-icon.png"/&gt;
                &lt;local:ExhibitsPage Title="Exhibits" Icon="http://icons.iconarchive.com/icons/graphicloads/100-flat/256/home-icon.png"/&gt;
             &lt;/TabbedPage.Children&gt;
         &lt;/TabbedPage&gt;
     &lt;/MasterDetailPage.Detail&gt;
  &lt;/MasterDetailPage&gt;
  </code></pre>
  
  <hr>
  
  <p><strong>UPDATE:</strong> </p>
  
  <p>I made some changes as suggested by <em>SushiHangover</em>, I now recieve no errors but my tabbed menu is not appearing.</p>