学习WPF和MVVM-从头开始学习的最佳方法 [英] Learning WPF and MVVM - best approach for learning from scratch

查看:134
本文介绍了学习WPF和MVVM-从头开始学习的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有大约三年的c#经验.我想学习一些WPF和MVVM模式. 这个站点上有很多文章链接,但我有点不知所措. 对于初学者来说,明智的方法是暂时忘记mvvm并快速学习一点WPF,然后再回到MVVM?

I've got about three years c# experience. I'd like to learn some WPF and the MVVM pattern. There are a lot of links to articles on this site but I'm getting a little overwhelmed. Would a sensible approach for a begginer to be forget mvvm for a while and just quickly learn a bit a of WPF, then come back to MVVM?

我通过

I had a leaf through Application=Code+Markup - Charles Petzold in work today, it doesn't seem to mention MVVM (at least not in the index). I was pretty surprised by this as I thought MVVM was supposed to be the "lingua franca" of WPF?

我也刚开始在一家新公司工作,他们正在将MVVM与WinForms一起使用,以前有没有人遇到过这种情况?

Also I've just started working at a new company and they are using MVVM with WinForms, has anyone come across this before?

有人能推荐一本同时教我WPF和MVVM的书吗?

Can anyone recommend a book that will teach me both WPF and MVVM?

推荐答案

这取决于您的经验.

我个人认为这不是MVVM讨论中的一个不足之处,这就是促使我在从Windows Forms开发人员的角度来看,MVVM和WPF.

I personally felt that this was a lacking area in MVVM discussions, which was what led me to write my series on MVVM and WPF from a Windows Forms developer perspective.

如果不学习MVVM,我不会尝试学习WPF.最终,您将试图学习"许多方面,因为WPF确实完全没有意义,直到您了解了遍历整个体系结构的表示和逻辑的分离. MVVM实际上只是将这种分离扩展到了应用程序空间.

I would not try to learn WPF without learning MVVM. You'll end up trying to "unlearn" many aspects, as WPF really doesn't make sense, completely, until you understand the separation of presentation and logic that's pervasive throughout the architecture. MVVM is really just extending this same separation into the application space.

至于"Windows窗体中的MVVM"-很多人都试图这样做,但这并不是真正的MVVM.为了执行"MVVM",您需要访问比Windows Forms提供的更丰富的数据绑定形式.通常,"Windows窗体中的MVVM"实际上只是具有不同名称的Model-View-Presenter(我猜应该是乘搭MVVM潮流),但实际上与WPF中的MVVM并不相同.

As for "MVVM in Windows Forms" - a lot of people try to do this, but it's not really MVVM. In order to do "MVVM" you need access to a richer form of data binding than Windows Forms provides. "MVVM in Windows Forms" is really, typically, just Model-View-Presenter with a different name (riding the MVVM bandwagon, I'd guess), but not really the same as MVVM in WPF.

这篇关于学习WPF和MVVM-从头开始学习的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆