private async void AnalyzeButton_Clicked(object sender, EventArgs e) { Loading(true); var sentiment = await ServicioText.AnalyzeText(MessageEntry.Text); if (sentiment != null) { ScoreLabel.Text = sentiment.Score.ToString("N4"); } Loading(false); }
async void btnTraducirTarea_Clicked(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(txtTarea.Text)) { try { Loading(true); var texto = await ServicioText.TraducirTexto(txtTarea.Text); txtTask.Text = texto; Loading(false); } catch (Exception ex) { } } else { await DisplayAlert("Error", "The task can't be an empty string", "OK"); } }