Wednesday, June 10, 2009

WPF and MVVM - Orientation

It's been a while since my first post on this topic. Life is busy, and it's hard to fit in blogging.

In what time I have available I've been researching how to best achieve the separation of tasks described in the first post. There are quite a few blog entries out on the web, most of which really don't work except in specific cases, which, or course, the author presents. There are, though, several very good posts and two Microsoft sites that you may be interested in.

Joshua Smith has an excellent article and accompanying code example on MSDN: WPF Apps With The Model-View-ViewModel Design Pattern. In this article he introduces a concept which he calls the Relay Command.

Kent Boogaart has written a good series of articles. The final one in the series is MVVM Infrastructure: ActiveAware Command. The article contains links to the three prior articles in the series.

If you need to develop a large and/or complex WPF application, you might be interested in Microsoft's Prism - a composite application library. Check out Patterns & Practices: Composite WPF and Silverlight.

For smaller applications, Microsoft has a WPF MVVM Toolkit: WPF Toolkit - March 2009 Release.

In the end, and after a bit of experimentation, I decided to use an adaptation of the template that comes with the Microsoft toolkit. The template creates a solution with a single project with separate folders for the different segments of the MVVM pattern. I would have preferred separate projects in place of the folders, so I gave that a try, reworking the sample application that comes with the toolkit. It worked, so that's what I've decided to use in developing the Investment Tracking application.


Previous entries in this series:

WPF and MVVM - Intro

No comments:

Post a Comment