Mvvm: Tutorial from Start to Finish

MVVM: Tutorial from start to finish?

Your question really seems to be asking 2 questions:

  1. Where are some good tutorials on WPF, assuming I have no previous WPF experience?
  2. Where are some good tutorials on learning MVVM?

Some of these resources may be duplicated in previous answers...

Tutorials on WPF

  • A Guided Tour of WPF by Josh Smith

    I wrote a series of introductory WPF articles on The Code Project. The goal of those articles is to bring someone with no WPF experience up-to-speed enough so that (s)he can fully understand how the series’ demo application works.

  • Bea Stollnitz (link is to her archives) has a number of great articles on WPF.

  • WPF: A Beginner's Guide - Part 1 of n by Sacha Barber

  • WindowsClient.net WPF Training Videos

MVVM Tutorials

  • WPF Apps With The Model-View-ViewModel Design Pattern by Josh Smith (duplicate link already provided by Yacoder)

  • Jason Dolinger's presentation on the Model-View-ViewModel (link to video embedded in article)

  • Dan Crevier's DataModel-View-ViewModel pattern series (similar to MVVM)

Composite WPF (Prism) Resources

Though not exactly what you asked, it is the natural progression with WPF and MVVM.

  • Codeplex: Composite WPF (Prism)

  • Silver Bay Labs has a number of great videos on learning Prism

  • Channel 9: 10 step-by-step videos on using Silverlight and Prism

  • Codeplex: Introduction to Composite WPF (CAL, Prism): Part 1 (of n)

Beginner tutorial on MVVM?

I usually would say that this is off-topic, but this question is being asked so often, that it probably deserves an answer.

I swear by this gentleman and everyone I've recommended him to has been satisfied:

DCOM Engineering, LCC (YouTube): https://www.youtube.com/user/dcomnetwork

You will find two MVVM series. The first is the Introduction to Model-View-ViewModel Pattern series and the other is the Enterprise MVVM series. he posted the second one very recently. I would start with the first one to get a very clear understanding and move to the second one to solidify what you've learned.

He speaks clearly, in "plain-enough" language and does a very good job of covering topics without convolution involving finer details, in which most of the beginners get lost.

Learning WPF and MVVM - best approach for learning from scratch

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.

Need good MVVM tutorial for WPF

Probably the single most important MVVM article is Josh Smith's article from the MSDN magazine:

  • WPF Apps With The Model-View-ViewModel Design Pattern by Josh Smith

This article has a very nicely designed example application that accompanies it. However, it is a bit light in some areas. Another pair of articles I really like are:

  • MVVM for Tarded Folks Like Me
  • How Tards Like Me Make MVVM Apps

They are a bit more light in nature.


You can find more information relevant to your question Here.

MVVM - Model Tutorials?

There are many ways to approach this problem and which one you choose will be determined by the complexity of your application and your data model.

The standard way to approach this from a .NET point of view would be to create an Entity Framework model on top of your SQLite database. This will generate your object model and allow you to attach behaviour to it without too much fuss. It also somewhat abstracts the database/persistence from your application code (ViewModels). For details on this approach, search Google for 'Entity Framework' - there is a ton of information out there. EF has improved dramatically since the release of EF 4.0.

If you don't want to go with EF (due to complexity, overhead or just the desire to roll your own) then you're going to want to read up on popular data source architectural patterns. Start with Martin Fowler's Patterns of Enterprise Application Architecture - this book is the bible of data-driven application architecture. If you don't want to buy the book then read through the pattern descriptions, find an appropriate one and do a Google search - there is a ton of information about this stuff on the web.

If you have a complex model with loads of behaviour and patterns then you'll want to look at the Domain Model pattern for your model and probably the Data Mapper data source pattern for getting the data out of your DB and into your model. This is the most complicated approach, but the complexity pays off in flexibility down the road, if you need it.

If your data model is simpler then you may want to use either Table Data Gateway or Row Data Gateway for data access and probably Transaction Script or Service Layer for communication between the model and database.

I apologize for essentially bombarding you with links but the reality is when deciding on an architecture for an application it's important to do lots of research and above all learn and rely upon known solutions. Good luck.



Related Topics



Leave a reply



Submit