Prism2 with MVVM and Unity

Topics: Prism v2 - WPF 3.5
Feb 25, 2009 at 9:46 AM

I've been looking at the MVVM pattern recently and also Prism2. I was wondering, why do the Presenter (that's the ViewModel right?) and the View in the Prism2 samples have corresponding interfaces defined for them? Is it so that Unity can be used? The examples I've seen for MVVM don't use a classes derived from a specific interface.

Are there any examples of using MVVM with Prism2?

Thanks for your help.
Feb 25, 2009 at 5:35 PM


Interfaces for Views and ViewModels are not required by Unity to be able to inject them. Interfaces for Views or ViewModels allow you to test them in isolation by creating Mock classes for the dependencies between them. If you are not doing TDD nor mocking dependencies, there is no need for you to use interfaces.


In the source code and the documentation, the ViewModel (in M-V-VM) is referred as the Presentation Model, and they are basically the same thing in the WPF/Silverlight context.

That said, you can check the Reference Implementation or some of the QuickStarts to see examples of using Presentation Model with Prism-v2.


Please, let me know if this helps.


Ezequiel Sculli

Feb 25, 2009 at 8:46 PM
[gravy] Are there any examples of using MVVM with Prism2?

My project may be of interest to you.  I recently upgraded it to Feb 2009 release of CompositeWPF/Prism.  Many of the features you'll find (such as Unity integrated into WCF) are blogged about =>  (some blogs may be outdated but still provide the general idea).