MVVM Light Toolkit 设计方法(导航和视图加载)
我正在 Silverlight 中构建一个具有 4-5 个视图的简单应用程序。我遇到了 MVVM Light 工具包,我认为它适合我的需要。
背景
应用程序将具有包含典型列表和详细信息显示
- 制造商
- 产品
等的视图,以及左侧导航、页眉和页脚(用户控件)。
我正在考虑有一个主页,其中包含在设计时创建的用户控件。
问题
从左侧导航控件选择链接时,中央面板应更新为不同的视图(如制造商、产品等)
我知道 Messenger 是在不同虚拟机之间进行通信的一个选项工具包。
问题
我如何使用 MVVM light 工具包设计我的应用程序。中央窗格需要在运行时加载不同的视图。
我特别关注实现应用程序导航部分的帮助。
谢谢。
I am building a simple application with 4-5 views in Silverlight. I came across MVVM Light toolkit and I think it suits my need.
Background
Application will have views with typical list and details display
- Manufacturer
- Product
and so on with left navigation, header and footer (User controls).
I am thinking of having a main page with user controls created at design time.
Problem
On selection of links from left navigation control, the central panel should be updated with a different view (like Manufacturer, product and so on)
I understand that Messenger is an option to communicate between different VMs in light toolkit.
Question
How can I design my app with MVVM light toolkit. Central pane need to be loaded with a different view at runtime.
I am particularly looking at help in implementing the navigation portion of the application.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我必须以非 mvvm 方式实现基本的 nagivigtion。我的主视图的构造函数上有一个消息侦听器,用于侦听页面导航消息(自定义消息了解它、喜欢它、使用它),然后它将导航框架的内容源设置为在信息。我使用字符串常量设置了所有页面和子页面导航设置的 URL。
虚拟机中实际调用:
I had to implement basic nagivigtion in an NON mvvm way. I have a message listener sitting on the constructor of my main view that listens for a page navigation message(custom message learn it, love it,use it)then it sets the content source of the nav frame to the url that is sent in the message. I have the URLs for all my page and subpage navigation setup using string constants.
Actual Calling in VM: