github编辑

页面过渡

PageTransitions are used to render a transition between two views, for example in a Carouselarrow-up-right or TransitioningContentControlarrow-up-right

circle-exclamation

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.csarrow-up-right

Reference

CrossFadearrow-up-right

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.csarrow-up-right

Reference

PageSlidearrow-up-right

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.csarrow-up-right

Reference

CompositePageTransitionarrow-up-right

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.csarrow-up-right

Reference

IPageTransitionarrow-up-right

最后更新于

这有帮助吗?