Sunday, March 6, 2011

WPF/MVVM Quick Start Tutorial - CodeProject

Introduction to Article

Assuming that you have a decent understanding of C++ and a modest understanding of C#, getting started in WPF shouldn't be too difficult. I started looking at WPF 6 months ago, and after probably causing a spike in Google's searches, I finally started to understand and become productive with WPF (whether I've missed the boat on this one, is another story for another day).
As with learning any new technology, you get the benefit of hindsight. From my perspective, almost every tutorial on WPF I've come across is inadequate for one of several reasons:
  • the example is all in WPF
  • the example glosses over the key facts that would actually make your life easier.
  • the example tries to show off WPF's capabilities with lots of pointless effects that aren't helping you.
  • the example uses classes that have properties that appear far too similar to framework keywords and classes, and are therefore difficult to idenfity in the (XAML) code as being user defined (ListBox GroupStyle's Name is a complete headache for novices).
So to address this, I've written this based on what I would have liked to have found as the #1 hit on Google after typing 'WPF Tutorial'. This article may not be 100% correct, or even do things 'the one true way', but it will illustrate the main points that I wish I had found in one place 6 months ago.
I will quickly introduce some topics, then show an example that explains or demonstrates each point. Accordingly, I haven't really attempted to make the GUIs pretty, that's not the point of this article (see the bullet points above).
As this tutorial is quite long, I've elided quite a lot of code for brevity, so please download the attached zip file, and look at the examples (.Net 4.0/VS2010). Each example builds on the previous one.


WPF/MVVM Quick Start Tutorial - CodeProject
Enhanced by Zemanta

No comments:

Post a Comment