private void OnPhotoRemovedFromSet(object sender, RemovePhotoFromSetEventArgs e)
        {
            PhotoSet photoSet = PhotoSetCache[e.SetId];
            Photo photo = PhotoCache[e.PhotoId];

            if (photoSet.Photos.Contains(photo))
            {
                photoSet.Photos.Remove(photo);
                photoSet.PhotoCount--;

                // Dispatch event
                RemovePhotoFromSetCompleteEventArgs evt = new RemovePhotoFromSetCompleteEventArgs();
                evt.PhotoId = photo.ResourceId;
                evt.SetId = photoSet.ResourceId;
                RemovePhotoFromSetCompleted.DispatchEvent(this, evt);
            }
        }
        private void OnRemovePhotoCompleted(object sender, RemovePhotoFromSetCompleteEventArgs e)
        {
            Dispatcher.BeginInvoke(() => {
                if (e.PhotoId != currentProcessinPhotoId)
                    return;

                currentProcessinPhotoId = null;
                PhotoListView.Opacity = 1;
                PhotoListView.IsEnabled = true;

                ThrottleProgressBar.Visibility = Visibility.Collapsed;
                ThrottleLabel.Foreground = normalMessageBrush;
                ThrottleLabel.Text = AppResources.PhotoCollectionPhotoRemovedText;

                if (SelectedPhotos.Contains(e.PhotoId))
                    SelectedPhotos.Remove(e.PhotoId);
            });
        }
        private void OnPhotoRemovedFromSet(object sender, RemovePhotoFromSetCompleteEventArgs e)
        {
            Dispatcher.BeginInvoke(() =>
            {
                if (e.SetId != PhotoSetSource.ResourceId || PhotoSetSource.Photos.Count == 0)
                    return;

                if (addedPhotoIds.Contains(e.PhotoId))
                {
                    addedPhotoIds.Remove(e.PhotoId);
                }

            });
        }