Transfer Prism Module into Legacy application

Topics: Prism v2 - WPF 3.5
May 12, 2010 at 8:25 AM
Edited May 12, 2010 at 11:51 AM


We wrote a green field project based on Prism Oct 2009 version. One of the module contains two views and get loaded into left hand and right hand region when the shell loads. The right hand view is a selection panel allows users to choose different criteria and by pressing the submit button, through event aggregation, the left hand view will be updated accordingly. We used View Injection and Supervising Presenter pattern.

We recently have a need to plug this module into a legacy application. The legacy application will simply load a wpf usercontrol and display it. We don't want to modify it into Prism.

In terms of modify the module to be used in this legacy application, what is the best approach and steps for doing it?

1. Shall I create a wpf usercontrol in legacy application and load the two views into this new usercontrol?

2. What modification do I need to allow me to use most of the existing prism logic? e.g. IOC, Event Aggregation, View Injection, Supervising Presenter


May 12, 2010 at 4:57 PM


If you want to include your module into a legacy application without adopting Prism in that application, a possible approach would be to create a “Module Bootstrapper”. The Bootstrapper would provide the module with the necessary infrastructure to fulfill its functionality. It could receive the UserControl created by the legacy application as a parameter in the CreateShell method, making that control the “Shell” for your module (you can read more about that in this article). That will automatically assign it a RegionManager making it possible to add views to it.

That way the new UserControl would behave as a Prism application’s Shell, but the rest of the application would stay unrelated to the Prism logic, as it is right now.

You can probably use the Unity Bootstrapper as a model for developing your “Module Bootstrapper”.

I hope you find this helpful.

Guido Leandro Maliandi