摘要:
前言MVVM 就是 Model – View – ViewModel 三组功能(类)分割的设计模式。废话不多说,不知道的自己上网查。用 MVVM 我认为最大好处是能对 ViewModel 做单元测试。另外,MVVM 分工也比较明显,方便安排程序员分组分工进行项目,基本设计有了之后可以各自敲。这样的话,写出来,类(class)最起码有三个。比如 Window1 作为 View,Window1ViewModel 作为 ViewModel,实际业务类比如 Sales Order 销售订单作为 Model。View 不一定要是 System.Control.Window,UserControl 也可以 阅读全文
posted @ 2013-06-03 11:50
三叶草╮
阅读(308)
评论(0)
推荐(0)
摘要:
ViewModelBase和CommandBase代码的整理如下:1.ViewModelBase.cs[c-sharp] view plaincopyusingSystem;usingSystem.ComponentModel;usingSystem.Linq.Expressions;///<summary>///WPFMVVC设计模式ViewMode基本功能类///</summary>publicabstractclassViewModelBase:INotifyPropertyChanged,IDisposable{#regionPublicProperties// 阅读全文
posted @ 2013-06-03 11:48
三叶草╮
阅读(955)
评论(0)
推荐(0)

浙公网安备 33010602011771号