Upgrade existing silverlight 4 app to prism

Topics: Prism v4 - Silverlight 4
Apr 30, 2011 at 11:10 PM
I'm working on a fairly large silverlight 4 app that I want to add prism to. The trouble is I need to be able to do it gradually, is there a way to leave existing pages views working at first and then add new modules bit by bit? Any help greatly appreciated!
May 2, 2011 at 5:45 PM


As explained on the Introductory Chapter of the Prism MSDN documentation, “It is important to note that Prism was designed so that you can use any of Prism's capabilities and design patterns individually, or all together, depending on your requirements and your application scenario. Prism was designed so that it could be incrementally adopted, allowing you to use the capabilities and design patterns that make sense for your particular application without requiring major structural changes.

Therefore, you could adopt Prism’s capabilities incrementally. However, there is no specific guidance on how to include legacy components into a Prism application. One possibility would be to wrap your existing functionality in a module, add your user controls as views in a region, and then start adding new components as different modules that fulfill different use cases.

If you’re using Silverlight Navigation Framework, you might find the following blog post by Karl Shifflett useful:

Prism 4 Region Navigation with Silverlight Frame Navigation

I hope you find this information useful.


Miguel Bronzovic

May 3, 2011 at 1:16 AM

Yes, I like the idea of wrapping the existing functionally in a module, but I'm wondering if there is a way to leave the old code it as is, gradually putting things in modules bit by bit, Is there a way to sort of bypass the bootstrapper for some of the application? Obviously our goal is to get everything in prism, this is just so we can do it gradually.

May 3, 2011 at 2:13 PM


You could set your main view as the Shell View in the bootstrapper (by overriding the CreateShell and/or InitializeShell methods in the bootstrapper), and leave all the files of your previous application in the shell project. That would make your application behave just the same as it did before.

Then, you could add an additional component in your application that contains a region, and that would be the point of extensibility for adding views from Prism modules.

I hope you find this helpful.

Guido Leandro Maliandi