private void OnPhotoSetPrimaryUpdated(object sender, ChangePhotoSetPrimaryEventArgs e)
        {
            PhotoSet photoSet = PhotoSetCache[e.SetId];
            photoSet.Primary = e.PhotoId;
            photoSet.PrimaryPhoto = PhotoCache[photoSet.Primary];

            PhotoSetPrimaryUpdatedEventArgs evt = new PhotoSetPrimaryUpdatedEventArgs();
            evt.PhotoSetId = e.SetId;
            PhotoSetPrimaryChanged.DispatchEvent(this, evt);
        }
        private void OnPrimaryPhotoChanged(object sender, PhotoSetPrimaryUpdatedEventArgs e)
        {
            Dispatcher.BeginInvoke(() => {
                if (e.PhotoSetId != PhotoSetSource.ResourceId)
                    return;

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

                StatusProgressBar.Visibility = Visibility.Collapsed;
                StatusLabel.Foreground = normalMessageBrush;
                StatusLabel.Text = "Done";
            });
        }