Composite Application Guidance and MVVM (ViewModel)

Topics: Prism v2 - Silverlight 2, Prism v2 - WPF 3.5
Mar 26, 2009 at 9:36 PM

I've been doing a lot of research on design pattern recommendations for use with the CAG.  It appears that the MVVM (or ViewModel) pattern is most recommend, especially when you are contemplating having both WPF and Silverlight UI's. 

Problem is that I cannot find a good sample application(s) that uses the CAG "and" MVVM together.  It appears to me that the Stock Trader RI is using a PresentationModel (a derivative of the MVP model).

I'm also looking for a sample that would allow a menu in one region and another region that would be loaded and unloaded as the user clicks the items in the menu of the 1st region.

Any help would be appreciated!

Mar 26, 2009 at 10:30 PM
Edited Mar 26, 2009 at 10:32 PM




As you mentioned, one of the recommended patterns for developing applications both for Silverlight and WPF is the MVVM pattern. This is because this pattern allows the maximization of the DataBinding capabilities provided.

PresentationModel is a synonym to MVVM or ViewModel (a thread talks about this).


In that thread Mariano Converti provides a link to a video, which he found useful to understand MVVM (there is a lot more information about MVVM, including other videos on the web). Two articles recently posted in the MSDN Magazine cover MVVM in WPF/Silverlight Applications:

·         Model-View-ViewModel In Silverlight 2 Apps

·         WPF Apps With The Model-View-ViewModel Design Pattern


For an example of MVVM with Prsim-v2 you can check the Reference Implementation. Some of the Quickstarts (like the View Injection one) also use MVVM, so perhaps you could check them out.

This article, from the Prism-v2 documentation, also talks about Presentation Model with Prism-v2.



For an example of changing the view of a “Main Region” based on clicking different menu buttons you could check this sample application by Erwin Van der Valk, developer of the Prism-v2 project. He shows an Outlook Style application which contemplates this kind of scenario.


Perhaps you could find useful a related thread that talks about a similar situation (and has links to other threads and documentation that might also be of help):

·         ContentControl in MainRegion


Please, let me know if this helps.


Damian Schenkelman

Mar 26, 2009 at 10:41 PM
Thanks for the quick response!

I guess I was confused as I thought I had read somewhere where the MVP pattern had since become known as the PresentationModel.  That makes sense that the PresentationModel is the MVVM pattern as it was used in the reference implementation.

Thanks for all the info.  I'll start digging through it all.  It appears this should help a bunch!