我有一個內置的動畫如何使用內置的動畫UWP
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;
}
我停靠的MainPage的構造這個方法,但我得到的錯誤:
'MainPage.SetUpPageAnimation()' is a new virtual member in sealed class 'MainPage'
什麼是錯在這裏? UPDATE - >我在XAML像這樣添加了動畫,它是工作:
<Page.Transitions>
<TransitionCollection>
<NavigationThemeTransition>
<NavigationThemeTransition.DefaultNavigationTransitionInfo>
<SlideNavigationTransitionInfo/>
</NavigationThemeTransition.DefaultNavigationTransitionInfo>
</NavigationThemeTransition>
</TransitionCollection>
</Page.Transitions>