学习 WPF 和 MVVM

编程入门 行业动态 更新时间:2024-10-25 16:25:02
本文介绍了学习 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?

我了解了 Application=Code+Markup - Charles Petzold 在今天的工作中,似乎没有提到 MVVM(至少在索引中没有).我对此感到非常惊讶,因为我认为 MVVM 应该是 WPF 的通用语言"?

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?

另外,我刚刚开始在一家新公司工作,他们正在使用带有 WinForms 的 MVVM,有没有人遇到过这种情况?

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 窗体开发人员的角度来看 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 Forms 中的 MVVM" - 很多人尝试这样做,但它并不是真正的 MVVM.为了执行MVVM",您需要访问比 Windows 窗体提供的更丰富的数据绑定形式.Windows 窗体中的 MVVM"通常实际上只是具有不同名称的模型-视图-演示者(我猜是跟随 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

本文发布于:2023-10-20 03:31:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1509715.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:WPF   MVVM

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!