public App() { AppP = new PropertiesManager(); Session = new SessionStore(); InitializeComponent(); //MainPage = new MainPage(); if (Properties.ContainsKey("Username")) { OnLogin(); } else { MainPage = new NavigationPage(new MainPage()); } SessionStatus is_logged = Session.IsLoggedIn(); switch (is_logged) { case SessionStatus.LoggedOut: NavigateMainPage(Pages.Landing); break; case SessionStatus.LoggedInWithActiveSession: NavigateMainPage(Pages.AfterLogin); break; case SessionStatus.LoggedInWithExpiredSession: NavigateMainPage(Pages.AfterLogin); break; default: NavigateMainPage(Pages.Landing); break; } }