private async void cmdOk_Clicked(object sender, EventArgs e) { try { gridProgress.IsVisible = true; await Task.Run(async() => { await SessionSingleton.LoginResourceOwner(txtEmail.Text, txtPassword.Text); IsCancelled = false; Device.BeginInvokeOnMainThread(() => { ClosePage(); }); }); } catch (Exception ex) { SessionSingleton.EndSession(); await App.Current.MainPage.DisplayAlert("Error", ex.Message, "OK"); } finally { gridProgress.IsVisible = false; } }
private void cmdOk_Clicked(object sender, EventArgs e) { SessionSingleton.EndSession(); ClosePage(); }