public App() { InitializeComponent(); var isLoggedIn = Properties.ContainsKey("IsLoggedIn") ? (bool)Properties["IsLoggedIn"] : false; // we remember if they're logged in, and only display the login page if they're not if (isLoggedIn) { MainPage = new NavigationPage(new Welcome()); } else { //MainPage = new Welcome(); MainPage = new LoginModalPage(this); } }
public void Logout() { Properties["IsLoggedIn"] = false; // only gets set to 'true' on the LoginPage MainPage = new LoginModalPage(this); }