Windows 8 Development-progressive page effects (transparency) in Metro applications)

Source: Internet
Author: User

In the onnavigateto event of a custom page or base class layoutawarepage (if this class is inherited), you can define such an animation effect:

Modify the transparency of the page from transparency gradient to opacity.

We recommend that you use a page based on layoutawarepage (Basic page) as much as possible, because many navigation functions and page lifecycle management are well encapsulated. In the page Jump process, the provided loadstate () and savestate () can be used to transfer and cache page parameters.

Here is a relatively simple animation effect:

/// <Summary> /// create a gradient animation when entering the view /// </Summary> private void shownavigationstoryboard () {storyboard Story = new storyboard (); doubleanimation animation; animation = new doubleanimation (); animation. from = 0.3; animation. to = 1; animation. duration = new duration (timespan. frommilliseconds (300); storyboard. settarget (animation, this); storyboard. settargetproperty (animation, new propertypath ("(uielement. opacity )"). path); story. children. add (animation); story. begin ();}

Among them, I wrote the shownavigationstoryboard () method to the onnavigateto event.

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.