的Windows Phone 8:如何动画页面导航?(Windows Phone 8: How to

2019-07-03 22:11发布

我是新来赢得Phone 8的开发和烦人徒劳的谷歌搜索后,我在这里发布这个简单的问题:

如何动画页面导航?

是的,我知道如何导航从一个网页到另一个:

NavigationService.Navigate(new Uri("/AnotherPage.xaml", UriKind.Relative));

但这种导航是瞬间,并且不包括任何种类的过渡。 请SO帮忙!

Answer 1:

您可以使用导航的转变从工具包。 http://phone.codeplex.com/



Answer 2:

安装使用的NuGet了Windows Phone工具包: https://nuget.org/packages/WPtoolkit 。

在app.xaml.cs:

RootFrame =新TransitionFrame();

然后,在你的页面XAML:

的xmlns:工具箱= “CLR-名称空间:Microsoft.Phone.Controls;装配= Microsoft.Phone.Controls.Toolkit”

<toolkit:TransitionService.NavigationInTransition>
    <toolkit:NavigationInTransition>
        <toolkit:NavigationInTransition.Backward>
            <toolkit:TurnstileTransition Mode="BackwardIn" />
        </toolkit:NavigationInTransition.Backward>
        <toolkit:NavigationInTransition.Forward>
            <toolkit:TurnstileTransition Mode="ForwardIn" />
        </toolkit:NavigationInTransition.Forward>
    </toolkit:NavigationInTransition>
</toolkit:TransitionService.NavigationInTransition>
<toolkit:TransitionService.NavigationOutTransition>
    <toolkit:NavigationOutTransition>
        <toolkit:NavigationOutTransition.Backward>
            <toolkit:TurnstileTransition Mode="BackwardOut" />
        </toolkit:NavigationOutTransition.Backward>
        <toolkit:NavigationOutTransition.Forward>
            <toolkit:TurnstileTransition Mode="ForwardOut" />
        </toolkit:NavigationOutTransition.Forward>
    </toolkit:NavigationOutTransition>
</toolkit:TransitionService.NavigationOutTransition>


文章来源: Windows Phone 8: How to animate page navigation?