Page navigation animation in WP 8.1 while the current page remains stationary

In the WP 8.1 Store app, how can I change the animation of the page when navigating to another page in the frame so that the current page stays stationary when the new page is animated on top of it, going from the top of the screen to the bottom?

I am currently animating my navigation like this:

protected override void OnNavigatedTo(NavigationEventArgs e)
{
     Frame.ContentTransitions = new TransitionCollection
     {
            new PaneThemeTransition{Edge = EdgeTransitionLocation.Top}
     };
}

      

But this will animate both pages, moving the current one from bottom to top, and the second one simultaneously moves from top to bottom. I also see a black background while the pages are moving for an area of ​​the screen that is not occupied by any content.

+3


source to share


2 answers


You, unfortunately, cannot navigate to another page and keep the previous page while animating. This is why all Transitions pages now only support In-Transition and Out-Transition. We've been discussing this issue with Microsoft devs over the years. // Build, so I'm confident about this information.

If you really want this effect, you can achieve it using a workaround. Instead of placing your content on separate pages, you should create custom controls and animate them while staying on the same page. However, this can be a little tricky due to the fact that you manually manage the "navigation" between custom controls, instead of having to deal with it for normal pages.



More information on how to implement animation in Windows Phone Silverlight Apps can be found in this article: http://msdn.microsoft.com/en-us/library/windows/apps/jj206955%28v=vs.105%29.aspx

0


source


I had a similar problem a while ago and this is also a workaround, but it might do the trick for you.

You can place the Frame object using all the free space on your current page. Then, instead of navigating from the current page frame, you navigate out of the Frame object that you place on top of your actual page.



The problem with this approach is that you actually "get rid" of the first page. But it might work for you, or at least give you another insight into the problem.

0


source







All Articles