如何在 Silverlight 3 中将 .NET RIA 服务与 MVVM 结合起来?

发布于 2024-07-15 04:31:34 字数 102 浏览 4 评论 0原文

.NET RIA 服务被描述为 Silverlight 的 n 层框架。 我一直想知道这个框架和模型-视图-视图模型模式之间有什么关系。 它们是否存在冲突,或者您能看到协同组合的潜力吗?

The .NET RIA Services are described as an n-tier framework for Silverlight. I have been wondering what the relation is between this framework and the Model-View-ViewModel pattern. Are they in conflict or can you see the potential for synergic combination?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

深爱成瘾 2024-07-22 04:31:35

顺便说一句 - Shawn Wildermuth 在 3 月份发表了一篇简洁的 Silverlight MVVM 文章 2009 年 MSDN 杂志

BTW - Shawn Wildermuth has a nice succinct Silverlight MVVM article in the March 2009 issue of MSDN Magazine

满身野味 2024-07-22 04:31:35

Shawn Wildermuth 结合 RIA 服务和 MVVM 的示例:

http://wildermuth.com/2010/04/16/ Updated_RIA_Services_MVVM_Example

此外,codeplex 上的 PRISM 下载有这方面的文档,并且包括 MVVM 和 RIA 服务的快速入门和参考实现。

Shawn Wildermuth's example combining RIA Services and MVVM:

http://wildermuth.com/2010/04/16/Updated_RIA_Services_MVVM_Example

Also, the PRISM download on codeplex has docs on this, and includes quickstarts and reference implementations for MVVM and RIA Services.

柒夜笙歌凉 2024-07-22 04:31:35

我会问乔纳斯·福勒索。 他似乎对 SL 中的 MVVM 感兴趣。

http://jonas.follesoe.no/

I would ask Jonas Follesoe. He seems to be interested in MVVM in SL.

http://jonas.follesoe.no/

飘逸的'云 2024-07-22 04:31:34

.NET RIA 服务和 MVVM 是协同作用的,并不冲突。

例如,如果我编写一个在服务器上公开产品和类别的目录域服务,并且相应地在客户端上有一个目录域上下文...那么以下是根据情况使用的选项:

  1. 编写视图该模型包装目录域上下文并公开分发已加载到产品和类别列表中的数据子集的属性。 并公开在 Catalog 上翻转和调用方法的操作。

  2. 从视图模型中公开目录。 通常,这对于只读场景来说是完美的。

在任何一种情况下,您的视图模型都可以负责初始化目录并自定义其创建、设置等。

希望这可以帮助您开始思考如何有效地组合这些内容。

我们肯定会在未来推出的示例中展示其中的一些工作原理。

.NET RIA Services and MVVM are synergistic, and aren't in conflict.

For example, if I write a Catalog domain service that exposes Products and Categories on the server, and correspondingly have a Catalog domain context on the client... then the following are options to use depending on the scenario:

  1. Write a view model that wraps the Catalog domain context and exposes properties that hand out subsets of data that has been loaded into the Products and Categories lists. And expose operations that turn around and invoke methods on Catalog.

  2. Expose a Catalog out of the view model. Often this is perfect for read-only scenarios.

In either case your view model can take care of initializing the Catalog and customizing its creation, setup etc.

Hope that helps get you started in thinking how these might be effectively combined.

We'll definitely be showing some of this working in future samples we put out.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文