title: Can you change a tabbedpage's child navigation stack from app.xaml.cs?
body: <p>I'm trying to set up automatic logging in when a user reopens my app so that it will check for existing login credentials saved in app.current.properties and when finding some, navigate the user to the proper tabbedpage, and change the current page from the default login screen to the account main page.</p>
  
  <p>I've tried something that through research seemed like it should work, specifically accessing the child page in question (login) and pushing a new page onto it via its navigation element. This hasn't worked, and neither have some other much more janky solutions I've tried implementing. </p>
  
  <p>In App.xaml.cs</p>
  
  <pre class="lang-cs prettyprint-override"><code>protected override void OnStart()
          {
              AuthService.LoadUserCredentials();
  
              if (AuthService.authenticated)
              {
                  var page = new MainTabs();
                  page.CurrentPage = page.Children[2];
  
                  ContactService.RefreshData();
                  var page2 = new PinCodePage(false);
                  page.CurrentPage.Navigation.PushAsync(page2).ConfigureAwait(false);
  
                  MainPage = page;
              }
          }
  </code></pre>
  
  <p>Should note that my app is setup in a way that the mainpage of the whole application is a tabbedpage, which has 3 pages, the third one being the Login page. When a user normally logs in successfully, that page has a new page added over it, Account, and the Login page is popped out, effectively removing it. </p>
  
  <p>The expected result is that when a user opens the app after closing it/shutting it down after having been logged in, it checks for user stored info, and finding it, replaces the Login page with the Account page. If it finds nothing, it ignores the replacement of the login page and leaves it there.</p>