[WPF] MVVM的一点资源

1. Josh Smith发表在MSDN Maginze上的那篇《WPF Apps With The Model-View-ViewModel Design Pattern》,Link: http://msdn.microsoft.com/en-us/magazine/dd419663.aspx

John Gossman的《Introduction to Model/View/ViewModel pattern for building WPF apps》, Link: http://blogs.msdn.com/b/johngossman/archive/2005/10/08/478683.aspx

 

2. MVVM的本质是将UI跟后台的Logic彻底剥离,通过Binding来实现两者关联。然而,WPF现有的Functionality并不能满足这个需求。一个简单的例子是,在TreeView上实现双击(MouseDoubleClicked)事件,这个Event不能通过简单的Command进行binding。这就需要额外的工作,比如Attached Behavior:

 

Josh Smith在CodeProject上Article《Introduction to Attached Behaviors in WPF》,Link: http://www.codeproject.com/KB/WPF/AttachedBehaviors.aspx

 

偶个人推荐的一个很好的资源:Marlon Grech的AttachedCommandBehavior V2: http://marlongrech.wordpress.com/2008/12/13/attachedcommandbehavior-v2-aka-acb/

同样来自Markon Grech, 几个有用的Tips:

ListBox的多选模式的Binding: http://marlongrech.wordpress.com/2009/06/02/sync-multi-select-listbox-with-viewmodel/

使用ACB得到EventArgs: http://marlongrech.wordpress.com/2009/07/03/how-to-get-the-eventargs-as-a-commandparameter-using-the-attachedcommandbehaviour/

 

3. 另外一些成熟的封装库:

Sacha Barber的<Cinch>, Link: http://www.codeproject.com/KB/WPF/Cinch.aspx

Mark Smith (Julmar Technology)的<MVVM Helper Library>, Link: http://mvvmhelpers.codeplex.com/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值