开发者

Learning WPF and MVVM - best approach for learning from scratch [closed]

开发者 https://www.devze.com 2022-12-25 14:40 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_运维百科

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 5 years ago.

Improve this question

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?

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

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


It depends on your experience.

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.

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.

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.


Jason Dolinger has an excellent video on the subject. It steps you through the process moving from using code behind files to a full MVVM pattern including Dependency Injection and Testing.

Bill Steele did a 16 part "Soup-to-Nuts" webcast series on WPF. The links on the msevents site are broken. Here is a Google search to find them. This will help with the WPF learning curve. And he does NOT use any MV* patterns in his examples.

EDIT: The MSEvents links are working now, I am leaving the Google search as a backup.

Josh Smith also has an excellent article WPF Apps With The Model-View-ViewModel Design Pattern on MSDN.

Herding Code: Presentation Patterns with Jeremy Miller, Ward Bell, Rob Eisenberg and Glenn Block

  • Part 1
  • Part 2

MIX10:

  • Laurent Bugnion Understanding the Model-View-ViewModel Pattern
  • Rob Eisenberg Build Your Own MVVM Framework

And of course Reed Copsey's MVVM articles are worth a read as well.


I was told a few times that my MIX10 session was explaining the MVVM pattern well enough for beginners (even though some parts are actually quite advanced, so don't worry if you need to re-watch certain parts).

The session is at http://live.visitmix.com/MIX10/Sessions/EX14

Sorry for the self-promotion.

Cheers, Laurent


There aren't many books covering MVVM but there is one : Advanced MVVM

But there are lots of online resources and this one is a must read : WPF Apps With The Model-View-ViewModel Design Pattern

After that I suggest looking into frameworks like

  • MVVM Light Toolkit
  • Caliburn


To do big things (like learning WPF + MVVM) it is better to break the task in smaller steps.

I think that the best approach in this situation is to start by learning the UI part of Wpf. Learn XAML syntax, the layout system, the available controls and forget about binding and how to deliver data to the controls.

Once you know the UI basics of Wpf then it is time to move to MVVM. Learn how bindings work and the MVVM pattern.

In this Web you can find a tutorial focusing on the hands on but with the theory available:

http://www.learnmvvm.com


Here is a tutorial for MVVM http://www.codeproject.com/Articles/819294/Learn-WPF-MVVM-step-by-step-Basics-to-Advance-Leve which goes from basic to the advance level in 5 steps. So its like graduating from a 3 layer to full MVVM.

Learning WPF and MVVM - best approach for learning from scratch [closed]


Try this site. It collects the various resources at one place. http://learnandmasterwpf.blogspot.com/


I just read this book. It is not really about learning WPF, but it should be useful once you already know a bit of WPF and want to progress your understanding of MVVM.

http://www.amazon.co.uk/Pro-WPF-Silverlight-MVVM-Model-View-ViewModel/dp/1430231629

0

精彩评论

暂无评论...
验证码 换一张
取 消