Windows Phone page switching Animation

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.