void DeleteComment(PhotoCommentViewModel comment) { comment.IsDeleting = true; try { PhotoServiceClient svc = new PhotoServiceClient(); svc.DeleteCommentCompleted += (sender, e) => { comment.IsDeleting = false; if (e.Error != null) { e.Error.Handle(); } else { if (_comments != null) { _comments.Remove(comment); } } NotifyOfPropertyChange(() => HasComment); }; svc.DeleteCommentAsync(comment.Id); } catch { comment.IsDeleting = false; } }
void DeleteComment(PhotoCommentViewModel comment) { comment.IsDeleting = true; try { PhotoServiceClient svc = new PhotoServiceClient(); svc.DeleteCommentCompleted += (sender, e) => { comment.IsDeleting = false; if (e.Error != null) { e.Error.Handle(); } else { if (_comments != null) { _comments.Remove(comment); } } NotifyOfPropertyChange(() => HasComment); }; svc.DeleteCommentAsync(comment.Id); } catch { comment.IsDeleting = false; } }