WP Development Note--wp App add page jump animation

Source: Internet
Author: User

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}"

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.