UWP Page Transition Animations

China☆狼群 提交于 2019-12-05 03:23:25
JuniperPhoton

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!