コード例 #1
0
        private void ImageList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (ImageList.SelectedItem != null)
            {
                ListViewItem item        = (ListViewItem)ImageList.ContainerFromItem(ImageList.SelectedItem);
                Uri          imageSource = _imageUriGetterFunc(item.Content, true);

                if (_crossFadeBatch == null)
                {
                    // Save the previous image for a cross-fade
                    _previousSurfaceBrush.Surface     = BackgroundImage.SurfaceBrush.Surface;
                    _previousSurfaceBrush.CenterPoint = BackgroundImage.SurfaceBrush.CenterPoint;
                    _previousSurfaceBrush.Stretch     = BackgroundImage.SurfaceBrush.Stretch;

                    // Load the new background image
                    BackgroundImage.ImageOpened += BackgroundImage_ImageChanged;
                }

                // Update the images
                BackgroundImage.Source = imageSource;
                PrimaryImage.Source    = imageSource;

                if (!_transition.Completed)
                {
                    _transition.Cancel();
                }

                // Kick off a continuity transition to animate from it's current position to it's new location
                CompositionImage image = VisualTreeHelperExtensions.GetFirstDescendantOfType <CompositionImage>(item);
                _transition.Initialize(this, image, null);
                _transition.Start(this, PrimaryImage, null, null);
            }
        }
コード例 #2
0
        private void ThumbnailList_Loaded(object sender, RoutedEventArgs args)
        {
            if (_currentTransition != null)
            {
                DetailsInfo      info         = (DetailsInfo)_currentTransition.Payload;
                GridViewItem     item         = (GridViewItem)ThumbnailList.ContainerFromItem(info.thumbanil);
                CompositionImage image        = VisualTreeHelperExtensions.GetFirstDescendantOfType <CompositionImage>(item);
                ScrollViewer     scrollViewer = VisualTreeHelperExtensions.GetFirstDescendantOfType <ScrollViewer>(ThumbnailList);

                // Kick off the transition now that the page has loaded
                _currentTransition.Start(MyGrid, image, scrollViewer, ThumbnailList);
            }
        }
コード例 #3
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            if (_currentTransition != null)
            {
                Continuity.DetailsInfo info = (Continuity.DetailsInfo)_currentTransition.Payload;

                // Update the Thumbnail image to point to the proper album art
                ThumbnailImage.Source = new Uri(info.thumbanil.ImageUrl);

                // Kick off the transition now that the page has loaded
                _currentTransition.Start(MyGrid, ThumbnailImage, MyScroller, MyScroller);
            }
        }