页面过渡

PageTransitions are used to render a transition between two views, for example in a Carousel or TransitioningContentControl

Build-In PageTransitions

CrossFade

The CrossFade fades out the current view and fades in the new view by animating the opacity.

<CrossFade Duration="0:00:00.500" />

Source code

CrossFade.cs

Reference

CrossFade

PageSlide

The PageSlide slides the content either horizontally or vertically. You can specify the slide axis via the Orientation-property. The default value is Horizontal.

<PageSlide Duration="0:00:00.500" Orientation="Vertical" />

Source code

PageSlide.cs

Reference

PageSlide

CompositePageTransition

The CompositePageTransition is used create a combined transition of several different transitions. The below sample creates a transition which slides the views diagonal (horizontally and vertically at the same time) and also fades the views out and in.

Source code

CompositePageTransition.cs

Reference

CompositePageTransition

Custom PageTransitions

You can also create your own PageTransition by implementing the IPageTransition-interface.

The Interface has one member which you need to implement:

Example

Below is a sample which will shrink the old view and grow the new view in vertically direction.

Custom Transition Example

Source code

IPageTransition.cs

Reference

IPageTransition

最后更新于

这有帮助吗?