Page Transitions
PageTransitions
are used to render a transition between two views, for example in a Carousel or TransitioningContentControl
warning
The duration must be set before the transition is used and must be greater than 0. If not, you will get an error.
Build-In PageTransitions
CrossFade
The CrossFade
fades out the current view and fades in the new view by animating the opacity.
- XAML
- C#
<CrossFade Duration="0:00:00.500" />
var transition = new CrossFade(TimeSpan.FromMilliseconds(500));
Source code
Reference
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
.
- XAML
- C#
<PageSlide Duration="0:00:00.500" Orientation="Vertical" />
var transition = new PageSlide(TimeSpan.FromMilliseconds(500), PageSlide.SlideAxis.Vertical);
Source code
Reference
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.
- XAML
- C#
<CompositePageTransition>
<CrossFade Duration="0:00:00.500" />
<PageSlide Duration="0:00:00.500" Orientation="Horizontal" />
<PageSlide Duration="0:00:00.500" Orientation="Vertical" />
</CompositePageTransition>