问题
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?
回答1:
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.
回答2:
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.
来源:https://stackoverflow.com/questions/32579445/uwp-page-transition-animations