Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Phone 8: How to animate page navigation?

I am new to Win Phone 8 development and after a tiresome unfruitful Googling, I am posting this simple question here:

How to animate page navigation?

Yes, I know how to navigate from one page to another:

NavigationService.Navigate(new Uri("/AnotherPage.xaml", UriKind.Relative));

But this navigation is instant, and doesn't include any kind of transition. Please help SO!

like image 580
craftsman Avatar asked Nov 18 '12 12:11

craftsman


2 Answers

Install the Windows Phone Toolkit using Nuget: https://nuget.org/packages/WPtoolkit.

In app.xaml.cs:

RootFrame = new TransitionFrame();

Then, in your page XAML:

xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"

and

<toolkit:TransitionService.NavigationInTransition>     <toolkit:NavigationInTransition>         <toolkit:NavigationInTransition.Backward>             <toolkit:TurnstileTransition Mode="BackwardIn" />         </toolkit:NavigationInTransition.Backward>         <toolkit:NavigationInTransition.Forward>             <toolkit:TurnstileTransition Mode="ForwardIn" />         </toolkit:NavigationInTransition.Forward>     </toolkit:NavigationInTransition> </toolkit:TransitionService.NavigationInTransition> <toolkit:TransitionService.NavigationOutTransition>     <toolkit:NavigationOutTransition>         <toolkit:NavigationOutTransition.Backward>             <toolkit:TurnstileTransition Mode="BackwardOut" />         </toolkit:NavigationOutTransition.Backward>         <toolkit:NavigationOutTransition.Forward>             <toolkit:TurnstileTransition Mode="ForwardOut" />         </toolkit:NavigationOutTransition.Forward>     </toolkit:NavigationOutTransition> </toolkit:TransitionService.NavigationOutTransition> 
like image 97
trydis Avatar answered Oct 10 '22 16:10

trydis


You could use the navigational transitions from the toolkit. http://phone.codeplex.com/

like image 33
Andras Csehi Avatar answered Oct 10 '22 18:10

Andras Csehi