private async void LogInCommand() { IsDataLoading = true; WpaXmlRpcService service = new WpaXmlRpcService(); var result = await service.GetProfile(Login, Password); IsDataLoading = false; if (!result) { await dialogService.ShowMessage("L'identifiant ou le mot de passe n'est pas correct", "Identification"); } else { appSettings.Login = Login; appSettings.Password = Password; IsConnected = true; } }
private void SendCommentCommand() { IsDataLoading = true; WpaXmlRpcService xmlRpcService = new WpaXmlRpcService(); xmlRpcService.PostComment(postID, Comment).ContinueWith(async t => { if (t.IsFaulted) { await dialogService.ShowMessage("Une erreur s'est produite lors de l'envoi de votre commentaire.", "Erreur"); } else { Comment = string.Empty; await dialogService.ShowMessage("Votre commentaire a été envoyé.", "Votre commentaire"); await LoadComments(postID); } IsDataLoading = false; }, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.FromCurrentSynchronizationContext()); }