微软棱镜导航 [英] Microsoft Prism Navigation..

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

问题描述


我使用Microsoft Prism开发了一个带有两个模块的Silverlight项目.(模块1和模块2).在模块1中,有一个名为Module1View的视图.在模块2中有一个名为Module2View的视图.在我的Shell.xaml中,有两个按钮(模块1和模块2).当我单击Module1View按钮时,它将加载Module1View.单击Module1View按钮后,我单击Module2View按钮,然后向我显示两个ModuleViews(Module1View和Module2View).但是我一次只想要一个View.
我想要的是这样.当我单击Module1View按钮时,应该向我显示Module1View.然后单击Module2View按钮,它应该仅显示Module2View.如何执行此操作....

Hi,
I developed a silverlight project with two Modules.(Module1 and Module2) using Microsoft Prism.In Module1 there is a view called Module1View.In Module2 there is a view called Module2View.And in my Shell.xaml ,there are two buttons(Module1View and Module2View).When I click Module1View button it loads the Module1View.After clicking Module1View button I click the Module2View button and then it shows me both ModuleViews(Module1View and Module2View).But I want only one View at one time.
What I want is like this..When I click Module1View button it shoul show me Module1View.Then I click the Module2View button it should show only the Module2View.How can I do this....

推荐答案

您需要在shell中定义区域(我们称其为"main").

然后,当用户加载第一个模块/视图时,将其加载到主要"区域中.
然后,当用户加载第二个模块/视图时,请删除第一个模块/视图,然后将第二个模块/视图加载到主"区域中.

这就是区域的全部内容.
You need to define regions (lets call it "main") in your shell.

Then when a user loads the first module / view, load it in the "main" region.
Then when the user loads the second module / view, remove the first module / view and load the second one in the "main" region.

That is what regions are all about.



我试过了

Hi,
I tryied with this

regionManager.Regions["MainRegion"].Remove("Module1View");



但它说,区域管理器不包含MainRegion区域 ...该问题我该怎么办...



but it says, The region manager does not contain the MainRegion region...what can I do for this issue...


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

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