Microsoft's Toolkit team provided us with such a set of components, called transitionservices services.
Briefly describe the effect it has:
Turnstile (shaft rotation effect);
Turnstile Feather (feather-type shaft rotation effect);
Continuum (inherited animation effect);
Slide (sliding effect);
Rotate (rotation effect).
Here we implement the turnstile effect:
First, we want to download Silverlight for Windows Phone Toolkit
(No Windows Phone Toolkit can go to http://silverlight.codeplex.com/releases/view/55034/for download), and reference:
Second, the introduction of the App.xaml:
xmlns:toolkit="Clr-namespace:microsoft.phone.controls;assembly=microsoft.phone.controls.toolkit "
and add this snippet of code:
<!--application Resources-<Application.Resources> <style x:key="Pagetranstionstyle"Targettype="Phone:phoneapplicationpage"> <setter property="toolkit:TransitionService.NavigationInTransition"> <Setter.Value> <toolkit:NavigationInTransition> <toolkit:NavigationInTransition.Backward> <toolkit:turnstiletransition mode="Backwardin"/> </toolkit:NavigationInTransition.Backward> <toolkit:navigatio Nintransition.forward> <toolkit:turnstiletransition mode="Forwardin"/> </toolkit:NavigationInTransition.Forward> </toolkit:navigationint ransition> </Setter.Value> </Setter> <setter property="toolkit:TransitionService.NavigationOutTransition"> <Setter.Value> <toolkit:NavigationOutTransition> <toolkit:NavigationOutTransition.Backward> <toolkit:turnstiletransition mode="Backwardout"/> </toolkit:NavigationOutTransition.Backward> <toolkit:navigati Onouttransition.forward> <toolkit:turnstiletransition mode="Forwardout"/> </toolkit:NavigationOutTransition.Forward> </toolkit:navigationou ttransition> </Setter.Value> </Setter> </Style> </application. Resources>
Third, we need to modify the next thing in the App.xaml.cs file so that our animation can be called.
Found in CS file
New Phoneapplicationframe ();
This is the instantiation method of Phoneapplicationframe. Change it to:
New Transitionframe ();
So our frame becomes a frame that can have a jump-and-rotate picture.
Four, the next is called, this is very simple directly in the animation of the page to add this style can be:
style="{StaticResource Pagetranstionstyle}"