导航框架的转换内容控制(WCF RIA 服务)
我想在我的视图(页面)之间进行转换。但我找不到使用过渡内容控件的方法。 这是我的 xaml 代码。
<navigation:Frame x:Name="ContentFrame" Style="{StaticResource ContentFrameStyle}"
Source="/Home" Navigated="ContentFrame_Navigated" NavigationFailed="ContentFrame_NavigationFailed">
<navigation:Frame.UriMapper>
<uriMapper:UriMapper>
<uriMapper:UriMapping Uri="" MappedUri="/Views/Home.xaml"/>
<uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml"/>
</uriMapper:UriMapper>
</navigation:Frame.UriMapper>
</navigation:Frame>
</Border>
提前致谢
I want to make a transition between my views(pages). But i can't find a way to use the Transitioning Content Control.
Here is my xaml code.
<navigation:Frame x:Name="ContentFrame" Style="{StaticResource ContentFrameStyle}"
Source="/Home" Navigated="ContentFrame_Navigated" NavigationFailed="ContentFrame_NavigationFailed">
<navigation:Frame.UriMapper>
<uriMapper:UriMapper>
<uriMapper:UriMapping Uri="" MappedUri="/Views/Home.xaml"/>
<uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml"/>
</uriMapper:UriMapper>
</navigation:Frame.UriMapper>
</navigation:Frame>
</Border>
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
基本上,您需要做的就是通过用 TransitioningContentControl 替换其 ContentPresenter 来更改 Frame 的 ControlTemplate。
然后您需要为 TransitioningContentControl 创建一个新样式。在我为您创建的视觉状态中,您可以将它们替换为您想要的动画。请注意,
CurrentContentPresentationSite - 显示正在导航的页面
PreviousContentPresentationSite - 显示正在导航的页面
这里有相当多的代码,如果您有任何问题,请告诉我。 :)
basically what you need to do is to change the Frame's ControlTemplate by replacing its ContentPresenter with a TransitioningContentControl.
And then you need to create a new style for your TransitioningContentControl. In the Visual states I created for you, you can replace them with your desired animations. Please note,
CurrentContentPresentationSite - displays the page which is navigating in
PreviousContentPresentationSite - displays the page which is navigating away
There's quite a lot of code in here, please let me know if you have any questions. :)