IWP 58 | Put the Standard Animations in your App
- Posted: Jul 11, 2013 at 11:25 AM
- 32,655 Views
- 4 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Right click “Save as…”
One of the most beautiful design aspects of the Windows Phone OS is the use of motion design. Windows Phone is alive with motion, which acts as a huge differentiator in quality applications. Unfortunately, motion design can be very painstaking work and difficult to implement.
Fortunately the Windows Phone Toolkit has everything we need to implement powerful animations that bring your Windows Phone apps to life. In this video Shawn Oster walks us through the steps of adding the Windows Phone Toolkit and utilizing the transitions and tilt animations to make your app feel like a native part of the ecosystem.
To summarize our conversation, you can very easily add the basic page transition animation to your app in literally about 2 minutes.
Step 1: Install the Windows Phone Toolkit, or simple add the toolkit to your project using Nuget.
Note: If Nuget fails, check to see if an update is available from Tools > Extensions and Updates, under Updates > Visual Studio Gallery. You need Nuget >= version 2.1 to work with Windows Phone projects.
Step 2: (and we forgot to mention this in the video): In App.xaml.cs, locate:
RootFrame = new PhoneApplicationFrame;
and replace it with
RootFrame = new TransitionFrame();
Step 3: At the top of each page on which you want the transition to be used:
a. If the toolkit namespace is not defined, add it, (it will automatically be added if you have added any toolkit controls to the page previously):
Finally, add the following block fo XAML to each page, (above the LayoutRoot),
<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>