本文介绍了wpf mvvm混乱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据我对mvvm的理解.

as per my understanding about mvvm is.

有一个模型(也实现inotify ...的实体类),视图(xaml代码)和一些作为vm的类(通常继承icommand的控制器种类),使我们可以在特定事件上生成事件/命令事件...

there is a model (entity class that also implement inotify...), view (xaml code) and some class as vm (kind of controller which normally inherit icommand) to let us make events/commands to be generated on specific event...

我只是想知道viewmodel类和xaml类背后的代码之间的区别...为什么我们不简单考虑并增强其背后的代码...

m just wondering about difference between viewmodel class and xaml's code behind class... why don't we simply consider and enhance code behind...

我认为没有足够的理由证明这一点……

no considerable reason is in my mind to justify this...

或者请用示例编写somethng来清除mvvm ...以及为什么mvc或mvp对于wpf应用程序来说是地狱??

or kindly write somethng with example to clear mvvm... and why mvc or mvp is hell for wpf app????

推荐答案

该模型不实现INotifyPropertyChanged,而ViewModel则实现.实际的WPF视图数据绑定到ViewModel.现在有很多在线文档.

The Model does not implement INotifyPropertyChanged, the ViewModel does. The actual WPF view data-binds to the ViewModel. There is now a lot of documentation online for this.

http://msdn.microsoft.com/en-us/magazine /dd419663.aspx

http://blogs.msdn.com/johngossman /archive/2005/10/08/478683.aspx

MVVM与WPF相关联,因为WPF的数据绑定机制与该模式结合使用使可测试的GUI轻而易举.

MVVM is associated with WPF because WPF's data binding mechanism when combined with this pattern makes testable GUIs a breeze.

这篇关于wpf mvvm混乱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 22:24