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

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

问题描述

我已开始使用 Prism 和 Xamarin.Forms 在 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/主/沙盒/Xamarin/HelloWorld

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

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

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

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