First you will have to disable current Transitions for the Frame
- the best place would be in App.xaml.cs
where the rootframe
is created but it depends on how your App is initialized. Here for example is in MainPage constructor:
public MainPage()
{
this.InitializeComponent();
Frame mainFrame = Window.Current.Content as Frame;
mainFrame.ContentTransitions = null;
}
After you have disabled default Transitions, in every Page
you can define its own Transition:
In Page.xaml
:
<Page.Transitions>
<TransitionCollection>
<PaneThemeTransition Edge="Bottom"/>
</TransitionCollection>
</Page.Transitions>
I'm not sure if that is the exact animation you were looking for. More about animations you will find here at MSDN.
Of course you can also define Frame
's new ContentTransitions
, so that they would be as default for all Pages
- for example:
// instead of null put in MainPage constructor:
mainFrame.ContentTransitions = new TransitionCollection { new PaneThemeTransition { Edge = EdgeTransitionLocation.Bottom } };
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…