title: Change navigation page bar color and title color
body: <p>I have a Tabbed page attached is a Navigation page I want to change the color or the bar itself and the title color but I am getting a exception:</p>
  
  <blockquote>
    <p><strong>(System.NullReferenceException: Object reference not set to an instance of an object.)</strong></p>
  </blockquote>
  
  <p>How can I change the color of my navigation bar and title color?</p>
  
  <p>Here is my tabbed page xaml code:</p>
  
  <pre><code>&lt;TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
           xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
          xmlns:local="clr-namespace:TBSApp.View"
          x:Class="TBSApp.Tabbed_Page.TabPage"
          NavigationPage.HasNavigationBar="False"
          xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
          android:TabbedPage.ToolbarPlacement="Bottom"
          BarBackgroundColor="#fff"
          android:TabbedPage.BarItemColor="#bbbbbb"
          android:TabbedPage.BarSelectedItemColor="#fc5661"&gt;
  &lt;NavigationPage Title="Dashboard" Icon="home.png"&gt;
      &lt;x:Arguments&gt;
          &lt;local:Dashboard /&gt;
      &lt;/x:Arguments&gt;
  &lt;/NavigationPage&gt;
  </code></pre>
  
  <p></p>
  
  <p>Here is my Dashboard.xaml.cs code:</p>
  
  <pre><code>((NavigationPage)Application.Current.MainPage).BarBackgroundColor = Color.FromHex("#fff");
  ((NavigationPage)Application.Current.MainPage).BarTextColor = Color.FromHex("#203341");
  </code></pre>