private async void Button_OnClicked(object sender, EventArgs e) { try { App.CurrentUser = null; if (string.IsNullOrWhiteSpace(LoginEntry.Text)) { await DisplayAlert("Error", "Preencha o login", "OK"); LoginEntry.Focus(); return; } if (string.IsNullOrWhiteSpace(PwdEntry.Text)) { await DisplayAlert("Error", "Preencha a senha", "OK"); PwdEntry.Focus(); return; } var isLogged = await CheckLogin(LoginEntry.Text, PwdEntry.Text); if (!isLogged) { return; } await Navigation.PushAsync(new PurchaseOrderListPage()); } catch (Exception ex) { await DisplayAlert("Error", ex.Message, "OK"); } }
protected override void OnAppearing() { base.OnAppearing(); Device.BeginInvokeOnMainThread(async() => { await System.Threading.Tasks.Task.Delay(150); PwdEntry.Focus(); }); }