Xamarin Forms与Prism MasterDetail导航 [英] Xamarin Forms with Prism MasterDetail navigation

查看:80
本文介绍了Xamarin Forms与Prism MasterDetail导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始使用带有Xamarin.Forms的Prism在Xamarin Studio上构建应用程序.我的问题是,我似乎找不到代码片段作为应用程序内MasterDetail导航的示例.

I have started building an app on Xamarin Studio using Prism with Xamarin.Forms. My issue is that I can't seem to find a snippet of code as an example of MasterDetail navigation inside the app.

每次我导航到一个页面时,它只会在先前的主视图之上呈现一个新视图.是否在某个地方有示例,或有关如何使用可切换视图以在xamarin上实现带棱镜的主/详细导航的说明?我发现了一些Windows窗体应用程序的棱镜示例,但没有特定于xamarin窗体的示例.

Every time I navigate to a page it just renders a new view on top of the previous master view. Is there an example somewhere, or instructions on how to use switchable views in order to achieve master/detail navigation with prism on xamarin? I have found some prism examples for windows forms applications but nothing specific to xamarin forms.

在此先感谢您,对这个普遍性的问题表示歉意.

Thank you in advance and sorry for the generalized question.

推荐答案

查看Prism仓库中的沙盒示例.它实际上非常简单.

Check out the sandbox sample that is in the Prism repo.. It's actually quite simple.

https://github.com/PrismLibrary/Prism/tree/master/Sandbox/Xamarin/HelloWorld

您只需要从MasterDetilPage ViewModel调用Navigation.这将相应地设置详细信息"页面.

You just have to call navigate from your MasterDetilPage ViewModel. This will set the Detail page accordingly.

这篇关于Xamarin Forms与Prism MasterDetail导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆