protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { base.OnNavigatingFrom(e); if (e.NavigationMode == NavigationMode.Back) { NavigationService.Frame.SetListDataItemForNextConnectedAnnimation(ViewModel.SelectedImage); ImagesNavigationHelper.RemoveImageId(ImageGalleryViewViewModel.ImageGalleryViewSelectedIdKey); } }
public async Task LoadAnimationAsync() { var selectedImageId = ImagesNavigationHelper.GetImageId(ImageGalleryViewSelectedIdKey); if (!string.IsNullOrEmpty(selectedImageId)) { var animation = ConnectedAnimationService.GetForCurrentView().GetAnimation(ImageGalleryViewAnimationClose); if (animation != null) { var item = _imagesGridView.Items.FirstOrDefault(i => ((SampleImage)i).ID == selectedImageId); _imagesGridView.ScrollIntoView(item); await _imagesGridView.TryStartConnectedAnimationAsync(animation, item, "galleryImage"); } ImagesNavigationHelper.RemoveImageId(ImageGalleryViewSelectedIdKey); } }