private void OnPhotoRemovedFromGroup(object sender, RemovePhotoFromGroupCompleteEventArgs e) { Dispatcher.BeginInvoke(() => { if (e.GroupId != Group.ResourceId) return; if (Group.Photos.Count == 0) { StatusLabel.Text = AppResources.GenericNoContentFound; StatusLabel.Visibility = Visibility.Visible; PhotoStreamListView.Visibility = Visibility.Collapsed; } else { PhotoCollection.Clear(); List<PhotoGroup> photoGroups = rendererFactory.GeneratePhotoGroups(Group.Photos); foreach (var group in photoGroups) { PhotoCollection.Add(group); } StatusLabel.Visibility = Visibility.Collapsed; PhotoStreamListView.Visibility = Visibility.Visible; } }); }
private void OnRemovePhotoCompleted(object sender, RemovePhotoFromGroupCompleteEventArgs e) { Dispatcher.BeginInvoke(() => { if (e.PhotoId != currentProcessinPhotoId) return; currentProcessinPhotoId = null; PhotoListView.Opacity = 1; PhotoListView.IsEnabled = true; ThrottleProgressBar.Visibility = Visibility.Collapsed; ThrottleLabel.Foreground = normalMessageBrush; UpdateThrottleLabel(); if (SelectedPhotos.Contains(e.PhotoId)) SelectedPhotos.Remove(e.PhotoId); }); }
private void OnPhotoRemovedFromGroup(object sender, RemovePhotoFromGroupEventArgs e) { // Update group throttle info FlickrGroup group = GroupCache[e.GroupId]; Photo photo = PhotoCache[e.PhotoId]; if (group.ThrottleMode != "none") group.ThrottleRemainingCount++; if (group.Photos.Contains(photo)) { group.Photos.Remove(photo); group.PhotoCount--; // Dispatch event RemovePhotoFromGroupCompleteEventArgs evt = new RemovePhotoFromGroupCompleteEventArgs(); evt.PhotoId = photo.ResourceId; evt.GroupId = group.ResourceId; RemovePhotoFromGroupCompleted.DispatchEvent(this, evt); } }