tags:

views:

802

answers:

5

Hello, 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 this book 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?

+5  A: 

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.

Reed Copsey
WPF without MVVM is bewildering and frustrating. WPF with MVVM is liberating and exciting.
Robert Rossney
WPF really requires some form of separation of concerns or it just doesn't make sense...
Reed Copsey
@Reed - Thanks for the series, I've been looking for decent Winforms->WPF information.
Paolo
+3  A: 

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

Catalin DICU
+1 when playing with WPF and MVVM last weekend, I almost immediately ran into the limitation that I couldn't bind event handlers to the viewmodel. The frameworks you link to appear to fix that, so I'll definitely be checking them out!
Wim Coenen
+5  A: 

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

MIX10:

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

VoidDweller
that Jason Dolinger video is a great start.
Andrew Garrison
Yes, the Jason Dolinger video is what finally kicked on the lightbulb for me. Highly recommended.
billb
+4  A: 

Hi,

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

LBugnion
@Laurent: I missed that self-promotion before I added your session to my answer. :)
VoidDweller
A: 

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

WPFNovice