改变棱镜模块内的视图?
我已经启动并运行了 PRISM v2 (MV-VM) 应用程序。它有 4 个加载到选项卡控件中的模块。伟大的。 现在我的问题是 - 从这里去哪里?大多数教程似乎就到此为止了。
也许我想得太多了,但似乎我需要每个模块都是它自己的 PRISM 应用程序,但这不可能是正确的。
请帮助 PRISM n00b 弄清楚接下来该去哪里。
我接下来要做的事情:每个选项卡(模块)都有自己的工具栏和按钮等。单击按钮应该更改工具栏下方的内容(视图)。 如何使用 PRISM(正确)实现这一目标?每个模块(选项卡)都应该对其内容进行控制,但是,单击一个选项卡中的某些按钮可能会触发另一选项卡中的事件(因此使用 PRISM)。
那么在模块内更改视图的正确 PRISM 方法是什么?
So I have a PRISM v2 (M-V-VM) application up and running. It's 4 modules that load into a tab control. Great.
Now my question is - where to go from here? Most tutorials seem to stop at this point.
Maybe I'm overthinking this, but it almost seems like I'd need each module to be its own PRISM application, but that can't be right.
Please help a PRISM n00b figure out where to go from here.
What I'm looking to do next: Each tab (module) has its own toolbar with buttons, etc. Clicking a button should change the content (view) below the toolbar.
How to achieve this (correctly) with PRISM? Each module (tab) should have control over its content, however, clicking cetain buttons in one tab may trigger an event in another tab (hence the use of PRISM).
So what's the correct-PRISM way to change views within a module?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你思考这个问题有点困难。我会解释一下。
通常所说的“Shell”应该包含所有导航控件。例如,如果我想要一个选项卡式 UI,我的 Shell 将包含一个选项卡控件(通常您会使用 RegionName 来装饰该 TabControl,例如“ShellTabs”)。
您的模块将向这些 shell 元素贡献视图。假设您有电子邮件模块,它将为您的选项卡集合提供一个收件箱视图。它可以通过将这些视图注册到应用程序的 RegionManager 来提供这些视图(例如将您的视图注册到名为“ShellTabs”的区域)。
模块不必提供任何视觉效果。我的应用程序中有一个模块负责日志记录和其他后台进程。
希望这能够澄清一些术语并帮助您了解每个部分的职责。
I think you are thinking about this a bit hard. I'll explain.
What is commonly referred to as the "Shell" should contain all of your navigation controls. For example, if I wanted a tabbed UI, my Shell would contain a tab control (usually you'd decorate that TabControl with a RegionName, like "ShellTabs").
Your Modules will contribute views to these shell elements. So let's say you have the email module, it will contribute an inbox view to your collection of tabs. It could contribute these views by registering them with the RegionManager for the app (like registering your view with the Region called "ShellTabs").
Modules don't have to contribute anything visual. I have one module in our app that takes care of logging and other background processes.
Hopefully this clears up some of the nomenclature and helps you know what the responsibility of each part is.