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.