My name is Edward Tanguay. I'm an American software and web developer living and working in Berlin, Germany.
9 hours ago: Here's a use-case for datapod format, recording human-readable data that later can be used as a datasource: http://is.gd/eSsLg @pholdings.
9 hours ago: "Subscriptions are available to U.S. addresses only." http://www.highlights.com another global economy #fail.
10 hours ago: "Subscriptions are available to U.S. addresses only." http://www.highlights.com another global #fail.
11 hours ago: My notes on podcast with author Aimee Bender's Lemoncake book, "a normal kid punished by expectations of giftedness": http://is.gd/eSsLg.
12 hours ago: Interesting: "one page per book": http://openlibrary.org/about.
12 hours ago: Another after-work 8K, did 5K in 23:33, getting cooler here as #berlin #marathon approaches: http://is.gd/eSp95.
yesterday: C# CODE EXAMPLE: Extension method for checking regex in one line: http://is.gd/eQzyg.
yesterday: New podcast source: "I don't want to put you to sleep, but I want to be as rich, and rewarding, and resident as a dream.":http://is.gd/eQrdC.
yesterday: An intense colin marshall interview with michael silverblatt on the art of interviewing & more: http://is.gd/eQqve (search for "blatt").
yesterday: The stackexchange site for wordpress is up: get your answers / establish your reputation @cottonr http://wordpress.stackexchange.com.
2 days ago: "I've always felt that any time you can use a tuple, you should use a struct.": http://is.gd/eQm9V.
MVVM NOTES created on Tuesday, April 07, 2009 permalink
Notes: Overview of WPF/Silverlight code examples that help you learn MVVM
This is an overview of WPF and Silverlight code examples you can download that all use the MVVM pattern in some way. My experience is that MVVM code examples vary widely in approach, quality and completeness (some having INotifyPropertyChanged, some not, some making a repository, some binding to ViewModels, some to collections in ViewModels, some binding to classes with mock data, some providing the unit testing, etc.) My strategy in learning MVVM has been to remake one after another until I start to see some pattern of how they go about it, and start to notice code similarities and similar approaches. So this is a list of code examples I collected which go about the concepts of binding, commands, routing, xaml, injection, IoC, in a simple, understandable way, some do something useful, e.g. allow you to create/edit/save items in an XML file or database and some just attempt to teach one thing such as animation or validation within an MVVM context.
  1. Adding transitions to a MVVM based dialog: this is a simple but impressive graphic example of how to do 3D graphic transitions from page to page within a MVVM context.
  2. Implementing Model-View-ViewModel in WPF: this is a video and example project by Josh Smith, small, builds and explains it in an hour, has commands (but strangely no INotifyPropertyChanged), excellent example code to learn from.
  3. MVVM: binding to Commands in Silverlight: this is a very simple example of a "RelayCommand" which Josh Smith came up with for Silverlight, which makes your XAML not need code behind, the example is very small and learnable.
  4. MVVM RSS reader in Silverlight: This is an RSS reader app done in Silverlight, but has multiple screens and animation (second screen comes flying in from right), so it would be good to learn from, and small enough to easily comprehend the MVVM going on even if you are new to it. Also uses simple commands in Silverlight, nice examples in little code.
  5. MapperCommandBinding - Mapping commands in WPF: this an a WPF project that shows how to create a Ribbon menu within an MVVM pattern context.
  6. Simplifying the WPF TreeView by Using the ViewModel Pattern: this is a simple application, easily learnable which shows two tabs, each containing data which is searchable/navigatable all within a MVVM pattern context, very nice.
  7. Using RoutedCommands with a ViewModel in WPF: Josh Smith does this one in which he concentrates on routed commands, very straightforward easy to learn from but not a complete application in any way. Good if you want to learn routed commands.
  8. MVVM + Mediator + ACB = cool WPF App: this is a simple WPF application with NICE use of WPF effects and graphics which basically allows you to edit two tables in the database (developers and projects), it uses a library called FluidKit, the application has a database behind it with two tables, looks quite complete, lots of WPF graphical goodness (tranparent, fading borders, animated buttons), lots of real-application around the MVVM core, interesting: the views just usercontrols in the root directory and the "model" seems to be in "Backend" folder. I was able to download and restore the database, and and pointed to database in App.config, easy setup, was able to save view and edit data from without the application. This is a VERY good application to get started with, quite approachable.
  9. MSDN Article by Josh Smith: WPF Apps With The Model-View-ViewModel Design Pattern: good accompanying article, has an "application-like" feel, you can add customers but can't edit them, has unit tests, reads from an XML file, customer class uses IDataErrorInfo (apparently for validation), has commands, etc. RelayCommand, good example. This article has been refered to quite a bit as one that helps people advance in their understanding of MVVM.
  10. Animating when data changes: This is a very simple example of how a view bound to a ModelView and it performing animation upon changing the value, very nice small understandable chunk of functionality within MVVM.
  11. Code Project: Creating an Internationalized Wizard in WPF: this is a "complete app" in that you are asked to order a cup of coffee through 3 different screens and at the end it displays the price, nothing more, but you get the sense of maintaining state through different views, etc. Interestingly it does internationalization pretty well (my German operating system caused it to come up in German automatically and you can force it to French, Italian, English, all with .resx files, e.g. Strings.de-DE.resx. That in itself is a useful lesson. The class "CupOfCoffee" uses INotifyPropertyChanged, and you've got a ViewModel for each View.
  12. Exploring a Model-View-ViewModel Application; WPF Password Manager, Cipher Text: done by Karl Shifflet, he wanted to see how far MVVM could take him in business apps and writes a lot about how he coded this in his article, if you are looking to make a nice-looking WPF-goodness app, this application will get you there, it is also the most complete MVVM example app I have seen, it actually has a nice feel all the way through and the interface is something you would feel good presenting to your team as a prototype of what WPF can do, as far as functionality, you can even "meta edit" the form in that you can change which fields are required, etc. This goes far beyond what other example apps do. HOWEVER, this code example is only available in VB.NET. Karl used his XAML power toys which seem quite powerful, check them out.
  13. Jason Dolinger’s Model-View-ViewModel presentation: this is a simple stock application that allows you to type in a fake stock name and it will change the value of the stock in real time showing it go up and down, it's not a complete application but would be good to go through once just to see how they apply the MVVM concepts, quite small#.
  14. Crack.NET: this is an expert-level application that is both useful as a tool (using Crack.NET, you can view/modify any field/property on any object/type in any WPF or Windows Forms application running on your machine) as well as an example of MVVM. There is a .doc file that comes with this explaining all the details but if you are a WPF/MVVM beginner, this app is going to be overload for you.
  15. Ocean - looks interesting but I couldn't find anything but a framework without a real project, and it is in VB.NET. Seems like all of Karl Shifflett's projects are in VB.NET.
  16. Thinking with MVVM: Data Templates + ContentControl: This is a very simple example which just allows you to click on two buttons and change the main text. It doesn't even seem to have a Model (Settings), the ViewModel just seems to be acting as if there is a model. Would be good to remake and see what they were doing with this.
  17. Family.Show: this is a nice, complete WPF application with impressive graphics and effects, it enables you to build a family tree, does not save to a database but saves the information into a binary/xml mixed file, there are three versions in the download but I only got 3.0 to work (others wanted to connect to team foundation server), has an intro video, also has hands-on lab which shows you how to build an EventViewer with VS2008 and Expression Blend, although it is not based on MVVM either. So this is a decent project to look at, not for MVVM principles, but to get an idea of building a complete WPF application in general.
  18. Another sample of WPF application using the pattern MVVM: looks good but I get an error and could not hook in the Northwind database in such a way that it worked, get getting errors, would be nice to get working though, has a good and bad example for contrast apparently.
  19. Code Available from MVVM Talk: this is an application like the stock quote example but instead of stocks it keeps track of the temperature and speed of sensors, uses interfaces, MVVM structure isn't that organized.