Esempio n. 1
0
 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;
     }
 }
Esempio n. 2
0
 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;
     }
 }