async Task IngresarCommandOnclick() { try { if (CrossConnectivity.Current.IsConnected) { if (String.IsNullOrWhiteSpace(User_Entry)) { await Application.Current.MainPage.DisplayAlert("El campo correo", "Es obligatorio.", "OK"); } else { bool isEmail = Regex.IsMatch(User_Entry, @"\A(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)\Z", RegexOptions.IgnoreCase); if (!isEmail) { await Application.Current.MainPage.DisplayAlert("El campo correo", "Es incorrecto, revíse e intente de nuevo.", "OK"); } else { if (String.IsNullOrWhiteSpace(Password_Entry)) { await Application.Current.MainPage.DisplayAlert("El campo contraseña", "Es obligatorio.", "OK"); } else { MasterDetailPageView view = new MasterDetailPageView(); await App.Current.MainPage.Navigation.PushAsync(view); } } } } else { await Application.Current.MainPage.DisplayAlert("UPS", "Ocurrió un error, verifique su internet", "OK"); } } catch (Exception ex) { var error = ex.ToString(); } }
public App() { InitializeComponent(); MainPage = new MasterDetailPageView(); }