Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UWP Page Transition Animations

I programing in Windows 10 UWP. I have a Frame in Xaml that I would like to have the Page/Content to slide left and off screen when the use navigates away from the page to another page. Any Idea how to do Frame Navigation Animations?

like image 322
MiddleTommy Avatar asked Sep 15 '15 06:09

MiddleTommy


2 Answers

Try to use build-in animation:

protected virtual void SetUpPageAnimation()
{
    TransitionCollection collection = new TransitionCollection();
    NavigationThemeTransition theme = new NavigationThemeTransition();

    var info = new ContinuumNavigationTransitionInfo();

    theme.DefaultNavigationTransitionInfo = info;
    collection.Add(theme);
    this.Transitions = collection;
}

Call this method in Page's constructor and you will find that there will be animation when you enter or leave a Page.

There are few build-in animations which names end with Info, you should try them by yourself.

like image 52
JuniperPhoton Avatar answered Oct 26 '22 10:10

JuniperPhoton


There's a built-in way to do this, but that only supports a set of not customizable animations / page transitions.

If you want to do custom animations you'll need to implement your own Frame + Page subclasses, where your Pages contain their own entrance/leaving animations and your Frame calls these when navigating.

like image 33
Tamás Deme Avatar answered Oct 26 '22 09:10

Tamás Deme