MVVM RI does not use PRISM?!?

Topics: Prism v4 - Silverlight 4, Prism v4 - WPF 4
Aug 5, 2010 at 11:06 AM

I was really hoping to see MVVM RI use PRISM for Modularity-Unity/MEF, Regions, EventAggregator and Commands. It is certainly appreciated that we have MVVM as part of the Prism documentation and the two quickstarts on MVVM specifically. But the community did have a lot of material available on MVVM outside Prism already.

I think the objective of the MVVM RI should have been to use MVVM in a Prism project and tackle some of the challenges while doing that; specifically around view composition into regions (primarily using injection), tackling view transitions from viewmodels/regions, tackling common popup views from viewmodel like confirmation/messagebox that return simple info to the main views and tackling use-case popup views from viewmodel that use regions e.g. search popups, data edit popups that have effect on the main views.

So even though extremely happy with the inclusion of MEF into Prism, and extending prism to use the new SL4 features; slightly disappointed with the MVVM part.



Aug 5, 2010 at 4:14 PM

Thank you for the feedback. 

The CTP does not include everything we will be releasing by the time we are done with Prism v4.  There are a few things on the backlog that should address most of your feedback.

As far as the MVVM RI goes, the idea was to show a progression from the Basic MVVM quickstart, to the MVVM QS, to the MVVM RI where more complex scenarios were added and shown in isolation from other concepts that can cause confusion.  There is quite a bit of content out in the community around this take on the Presentation Model pattern, but there is a lot of content that is contradictory.  We have tried to distill all that into something consumable.  Is there anything specific you think we are missing with our guidance? 

For the more complicated scenarios with view transitions, popups, etc., we are currently working on a whole set of guidance around "Navigation" using MVVM that should handle a good bit of the problems there. 

Once we get the navigation guidance figured out, we will probably be re-visiting the Stock Trader RI, making it use MVVM, Regions, Navigation, the rest of Prism, and MEF.

 If there is something more specific you want in the guidance, please create an issue tracker item and get people to vote on it.

Michael Puleio


Aug 7, 2010 at 10:43 AM


I apologize for jumping to conclusion, I had not read the road map on the msdn blog; the navigation guidance is part of phase 2 which just started.

Here is the list of items that I think should be considered, some of them may already be on the team's list but I will mention them anyways:

1. Application Navigation guidance:

  • Navigation framework that has provisions for dirty tracking or checking whether screen transition at this point is possible or should the user be prompted for unsaved info etc something along the lines of ScreenConductor (a term discussed by John Papa and Ward Bells over several blog posts)
  • Passing context to the destination screen/views
  • The screen/views will be hosted in Prism regions
  • MEF to compose viewmodels/services etc

2. ViewModel initiating basic message box style popups, that present Yes/No/Cancel/OK responses

3. ViewModel initiating full use cases that show up as popups, that may or may not require a passed context (e.g. search X business entity popup  VS  open Y business entity for edit popup). The usecase that initiated these popups may or may not be waiting on and require a response from the popups.

4. Scoped containers and scoped popup regions e.g. consider an outlook style app where the mail and calendar module has separate popup regions that allows the user to open a popup in the mail module, edit some info, switch to calendar module without closing the mail popup, open a new calendar relevant popup here, work on this, close this, go back to mail module where he can still see the popup left open and continue working. OR in case I am on a dashboard where two areas on the screen allow me to open popups within their respective screen boundary. And the user can open one popup in one area, edit and then open second popup in the second area without closing the first one.

5. login/logout showing authorization based module loading and features. This has to do with the fact that I havent found a way to unload/reload/re-initialize Prism modules, so if a user logs out, I have to force an application shut down, because if another user logged in from the "logged out" screen on the same application session, things will go wrong.


These ones are not in the scope of PRISM per se, but they are part of the presentation tier and need consideration.

1. Using "model" from WCF RIA services in the MVVM

2. Best practices on the asynchronous service call mechanism from ViewModels focusing on code maintainability & run-time performance, should background thread be used, should UI Dispatcher be used, how to handle service call cascading, where response from one service may be required to execute the second service

3. Fully utilizing RX framework. some areas of use maybe around WCF RIA service calling and hiding asynchronous pattern etc


And once again, want to thank P&P for great frameworks including PRISM.

Aug 11, 2010 at 3:15 PM

No problem.  We do appreciate the feedback, which I have shared with the rest of the team.

Michael Puleio