简体   繁体   English

Silverlight 2 UI模式

[英]Silverlight 2 UI pattern

I have to build small (for now) admin app in Silverlight2, and would like to use some pattern for binding UI with my BL/DAL. 我必须在Silverlight2中构建小型(目前)管理应用程序,并想使用某种模式将UI与我的BL / DAL绑定。
I found view-model-viewmodel and mvp/mvc patterns, where first one (V/M/VM) is specially suited for WPF apps, because it uses rich capabilities of WPF data-binding options. 我发现了view-model-viewmodel和mvp / mvc模式,其中第一个(V / M / VM)特别适合WPF应用程序,因为它使用了WPF数据绑定选项的丰富功能。 What do you suggest? 你有什么建议? Can you write simple example of V/M/VM for SL2? 您能为SL2编写V / M / VM的简单示例吗?

Nikhil Kothari has a great set of examples (with code) on MV-VM in Silverlight as well as a framework built with some very nice extra features. Nikhil Kothari在Silverlight的MV-VM上有大量的示例(带有代码),以及带有一些非常好的附加功能的框架。 You should definitely check them out. 您一定要检查一下。 MV-VM in Silverlight Silverlight中的MV-VM

Microsoft的Patterns&Practices组已汇总了有关WPF和Silverlight应用程序的一些指导。

You might want to look at CSLA.NET for Silverlight . 您可能需要查看CSLA.NET for Silverlight I've heard good things about it but haven't gotten around to try it yet myself. 我听说过一些不错的东西,但还没有自己尝试一下。

CSLA .NET for Silverlight is a subset of CSLA .NET targeted at the Silverlight platform. 用于Silverlight的CSLA .NET是针对Silverlight平台的CSLA .NET的子集。 CSLA .NET for Silverlight offers nearly all the benefits of CSLA .NET on Silverlight, including data binding, validation, business rules, authorization, n-level undo and persistence. 用于Silverlight的CSLA .NET在Silverlight上提供了CSLA .NET的几乎所有优点,包括数据绑定,验证,业务规则,授权,n级撤消和持久性。

The result is that CSLA .NET for Silverlight enables the creation of a rich object-oriented business layer running on the Silverlight client, that can transparently communicate with CSLA .NET objects running on the web and application servers. 结果是CSLA .NET for Silverlight可以创建在Silverlight客户端上运行的丰富的面向对象的业务层,该层可以与在Web和应用程序服务器上运行的CSLA .NET对象透明地通信。

Silverlight has also very powerful data-binding, so there is no problem with that. Silverlight还具有非常强大的数据绑定,因此没有问题。

The missing piece in Silverlight that affects more to the Model-View-ViewModel pattern is that it doesn't implements commands like WPF. Silverlight中缺失的部分对Model-View-ViewModel模式的影响更大,因为它没有实现WPF之类的命令。 Here is an article by Josh Smith that reproduces the command pattern of WPF in Silverlight. 是Josh Smith的文章,它在Silverlight中再现了WPF的命令模式。

Wildermuth.com的Shawn Wildermuth撰写了有关MV-VM模式的文章,请查看,这里是文章“ Silverlight 2 Apps中的Model-View-ViewModel”的链接

Norwegian developer Gjøran had a very nice presentation/demo at MSDN Live about writing business apps in WPF. 挪威开发人员Gjøran在MSDN Live上做了一个非常不错的演示/演示,内容涉及在WPF中编写业务应用程序。 Really it was about using Presentation Model with Silverlight/WPF. 确实,这是关于将演示模型与Silverlight / WPF一起使用。 Have a look at the source code from this article on his blog (sorry, the slides are in Norwegian only). 在他的博客上看看本文的源代码 (对不起,幻灯片仅适用于挪威语)。 Presentation Model + silverlight 2 rocks!!! 演示模型 + silverlight 2块摇滚!!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM