title: MasterDetail Icon not shown if the page is navigated to from Login Page at start
body: <p>So my app tries at the start to log in with saved between sessions login information.</p>
  
  <p>Something like this:</p>
  
  <pre><code>public App()
  {
      if (DoLogin(UserData) == LoginStatus.Success)
          MainPage = new NavigationPageNoLine(new MainAppPage());
      else
          MainPage = new NavigationPageNoLine(new LoginPage());
  }
  </code></pre>
  
  <p>where MainAppPage is a MasterDetailPage.</p>
  
  <p>If there is UserData saved between the sessions of the app, then the MainPage is the MasterDetailsPage where everything is in place and the MasterDetails icon appears as it should be:
  <a href="https://i.stack.imgur.com/EgGCZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EgGCZ.png" alt="enter image description here"></a></p>
  
  <p>But when there is no UserData saved, the LoginPage appears, where, after the login process is completed, I set:</p>
  
  <pre><code>Application.Current.MainPage = new NavigationPageNoLine(new MainAppPage());
  </code></pre>
  
  <p>Everything is ok except in this case the master details icon does not appear in the page:
  <a href="https://i.stack.imgur.com/l5JsG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l5JsG.png" alt="enter image description here"></a></p>
  
  <p>The drawer is working perfectly in both cases. Only the icon disappears in the Login scenario.</p>
  
  <p>How to make sure the icon appears in all cases?</p>
  
  <p>Thank you in advance for any help.</p>
  
  <p>Here is the MainAppPage.xaml:</p>
  
  <pre><code>&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"
                x:Class="AppName.View.MainAppPage"
                xmlns:local="clr-namespace:AppName.Helpers;assembley=Colors"
  
                Title="{i18n:Translate NewsPageTitle}"&gt;
   &lt;MasterDetailPage.Master&gt;
    &lt;ContentPage Title ="Options"&gt;
      &lt;StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Padding="5,0,5,0"&gt;
  
      &lt;ListView IsGroupingEnabled="False"
                  ItemsSource="{x:Static apploc:Settings.OptionMenuItems}"
                  IsPullToRefreshEnabled="False"
                  HasUnevenRows="False"
                  x:Name="ListViewOptions"
                  HorizontalOptions="FillAndExpand"
                  SeparatorVisibility="None"
                  VerticalOptions="FillAndExpand"&gt;
          &lt;ListView.ItemTemplate&gt;
            &lt;DataTemplate&gt;
              &lt;ViewCell&gt;
                &lt;Grid Padding="5,5" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"&gt;
                  &lt;Grid.ColumnDefinitions&gt;
                    &lt;ColumnDefinition Width="2*"/&gt;
                    &lt;ColumnDefinition Width="8*"/&gt;
                  &lt;/Grid.ColumnDefinitions&gt;
                  &lt;Image Grid.Column="0" Aspect="AspectFit" Source="{Binding IconSource}" HorizontalOptions="Center" VerticalOptions="Center"/&gt;
                  &lt;Label Grid.Column="1"
                         Text="{Binding Title}"
                         HorizontalOptions="Start"
                         TextColor="{x:Static local:Colors.PrimaryText}"
                         VerticalOptions="Center"
                         FontAttributes="Bold"&gt;
                    &lt;Label.FontSize&gt;
                      &lt;OnPlatform x:TypeArguments="x:Double" iOS="14" Android="14" WinPhone="11" /&gt;
                    &lt;/Label.FontSize&gt;
                  &lt;/Label&gt;
                &lt;/Grid&gt;
              &lt;/ViewCell&gt;
            &lt;/DataTemplate&gt;
          &lt;/ListView.ItemTemplate&gt;
        &lt;/ListView&gt;
      &lt;/StackLayout&gt;
    &lt;/ContentPage&gt;
  &lt;/MasterDetailPage.Master&gt;
  &lt;MasterDetailPage.Detail&gt;
    &lt;ContentPage Title ="Feeds"&gt;
      &lt;AbsoluteLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"&gt;
   ...
      &lt;/AbsoluteLayout&gt;
     &lt;/ContentPage&gt;
   &lt;/MasterDetailPage.Detail&gt;
  &lt;/MasterDetailPage&gt;
  </code></pre>
  
  <p>and here is my MainAppPage.xaml.cs:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  
  using Xamarin.Forms;
  using AppName.Resx;
  
  namespace AppName.View
  {
    public partial class MainAppPage : MasterDetailPage
    {
      public MainAppPage()
      {
          InitializeComponent();
  
          ListViewOptions.ItemSelected += async (sender, e) =&gt; await NavigateTo(e.SelectedItem as OptionsMenuItem);
      }
  
      private async Task NavigateTo(OptionsMenuItem menuItem)
      {
          if (menuItem == null)
              return;
          if (menuItem.TargetType == null)
              return;
  
          Page displayPage;
          try
          {
              if (menuItem.TargetType == typeof(WebPage))
                  displayPage = (Page)Activator.CreateInstance(menuItem.TargetType, menuItem.TargetUri, menuItem.Title);
              else
                  displayPage = (Page)Activator.CreateInstance(menuItem.TargetType);
  
              await Navigation.PushAsync(displayPage, true);
          }
          finally
          {
              ListViewOptions.SelectedItem = null;
              IsPresented = false;
          }
      }
    }
  }
  </code></pre>