public App() { InitializeComponent(); // notify.MakeAlarm(); try { if (db.LoggedInStatus() != null && db.GetUserName() != null) { //MainPage = new NavigationPage(new ModalPushedEventArgs(MainActivity())); MainPage = new NavigationPage(new MainActivity("")); // MainPage = new ModalPushedEventArgs } else { MainPage = new NavigationPage(new SignUp()) { BarBackgroundColor = Color.FromHex("#66C8F3"), BarTextColor = Color.White, Title = "Diabetics App" }; } } catch (NullReferenceException es) { MainPage = new NavigationPage(new SignUp()) { BarBackgroundColor = Color.FromHex("#66C8F3"), BarTextColor = Color.White, Title = "Diabetics App" }; } catch (ArgumentOutOfRangeException ew) { MainPage = new NavigationPage(new SignUp()) { BarBackgroundColor = Color.FromHex("#66C8F3"), BarTextColor = Color.White, Title = "Diabetics App" }; } catch (Exception ep) { MainPage = new NavigationPage(new SignUp()) { BarBackgroundColor = Color.FromHex("#66C8F3"), BarTextColor = Color.White, Title = "Diabetics App" }; } }