private void DetailsPage_BackRequested(object sender, Windows.UI.Core.BackRequestedEventArgs e) { if (_rootFrame.CanGoBack && !e.Handled) { //Set up visuals so that it is reparented to root frame and visible when pages change ContainerVisual newContainerVisual; ContinuityHelper.SetupContinuity(_parameterObject.imageContainerVisual, HeroRectangle, out newContainerVisual); e.Handled = true; _parameterObject.imageContainerVisual = newContainerVisual; Windows.UI.Core.SystemNavigationManager.GetForCurrentView().BackRequested -= DetailsPage_BackRequested; //Go back to previous page _rootFrame.GoBack(); } }
private void FruitsList_ItemClick(object sender, ItemClickEventArgs e) { //Set up item before user naivate //Hook up clicked item's composition visual to the rootframe and update data source with new contianervisual for further reference. //Hook up containerVisual to UIElement so that you can easily query its children and manipulate SpriteVisual. ContainerVisual tempContainer; try { ContinuityHelper.SetupContinuity((e.ClickedItem as Item).imageContainerVisual, (e.ClickedItem as Item).rectImage, out tempContainer); //Update datasourece with new containerVisual for future refernece (e.ClickedItem as Item).imageContainerVisual = tempContainer; //keep track of object that was sent in case of back button click. _incomingObject = e.ClickedItem as Item; //navigate to new page this.Frame.Navigate(typeof(DetailsPage), e.ClickedItem); } catch { throw; } }