First, modify the rootframe in the initializephoneapplication () function in APP. XAML. CS to rootframe = new transitionframe ();
Add xmlns: Toolkit = "CLR-namespace: Microsoft. Phone. controls; Assembly = Microsoft. Phone. Controls. toolkit" to XAML"
Add
<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>
Toolkit provides five animation effects: 1. rolltransition 2. rotatetransition 3. slidetransition 4. swiveltransition 5. turnstiletransition; we can also implement our own animation by inheriting the transitionelement.
If many pages require these effects, you can also add the effect as a style to the resource file to provide other pages for use.
<Application. Resources>
<Style X: Key = "transitionpagestyle" targettype = "Phone: phoneapplicationpage">
<Setter property = "toolkit: transitionservice. navigationintransition">
<Setter. value>
<Toolkit: navigationintransition>
<Toolkit: navigationintransition. Backward>
<Toolkit: turnstiletransition mode = "backwardin"/>
</Toolkit: navigationintransition. Backward>
<Toolkit: navigationintransition. Forward>
<Toolkit: turnstiletransition mode = "forwardin"/>
</Toolkit: navigationintransition. Forward>
</Toolkit: navigationintransition>
</Setter. value>
</Setter>
<Setter property = "toolkit: transitionservice. navigationouttransition">
<Setter. value>
<Toolkit: navigationouttransition>
<Toolkit: navigationouttransition. Backward>
<Toolkit: turnstiletransition mode = "backwardout"/>
</Toolkit: navigationouttransition. Backward>
<Toolkit: navigationouttransition. Forward>
<Toolkit: turnstiletransition mode = "forwardout"/>
</Toolkit: navigationouttransition. Forward>
</Toolkit: navigationouttransition>
</Setter. value>
</Setter>
</Style>
</Application. Resources>
Http://silverlightchina.net/html/zhuantixilie/winphone7/2012/0722/17574.html
In the XAML file:
Toolkit: the animation that transitionservice. navigationintransition comes in.
Toolkit: navigationintransition
Toolkit: navigationintransition. Backward: move back to the animation
Toolkit: navigationintransition. Forward: Enter the animation
Toolkit: transitionservice. navigationouttransition
Toolkit: navigationouttransition
Toolkit: navigationouttransition. Backward: exit the animation
Toolkit: navigationouttransition. Forward: Forward and exit Animation
Animation Enumeration
Toolkit: slidetransition fly into animation
Mode
Slideupfadein flies up
Slideupfadeout fly up
Slidedownfadein flies down
Slidedownfadeout
Slideleftfadein flies to the left
Slideleftfadein flies to the left
Sliderightfadein flies to the right
Sliderightfadein flies to the right
Toolkit: rolltransition 360 rotating Animation
Toolkit: rotatetransition rotation Animation
Mode
In180clockwise 180 clockwise Transfer
Out180clockwise 180 clockwise Transfer
In180counterclockwise 180 counterclockwise Transfer
Out180counterclockwise 180
In90clockwise 90 clockwise Transfer
Out90clockwise 90 clockwise Transfer
In90counterclockwise 90 counterclockwise Transfer
Out90counterclockwise 90 clockwise Transfer
Toolkit: swiveltransition vertical flip Animation
Mode
Backwardin forward
Backwardout
Forwardin forward Transfer
Forwardout
Fullscreenin full screen transfer-in
Fullscreenout
Toolkit: turnstiletransition flip Animation
Mode
Backwardin backward flip
Backwardout flip back
Forwardin forward
Forwardout