Migrate WPF/Prism app to the web/HTML5/JS

Topics: Prism v4 - Silverlight 4, Prism v4 - WPF 4
Feb 14, 2012 at 2:56 PM

I'm trying to get started on understanding what is involved in migrating an existing desktop solution to the web.

We've followed most of the Prism patterns and practices and it is a joy coding under such architecture and design.

The desktop solution is:

  • C#/WPF/.Net 4.0
  • Prism/MEF 4.0
  • MVVM and heavy use of Event Driven Architecture
  • Very clear separation of the views/UI
  • Repository/Unit of work pattern to the database 
  • Currently built as a client/server system (no web services)

Next step is to get something running in a browser so the plan is add or migrate some portion of it to Silverlight.  We figure that is the fastest track given we're in WPF now.

However, there is the future to consider in having a fully implemented version for the browser that will hopefully be cross-platform including mobile/iOS devices.  The idea at this stage is to target HTML5/JS.

That raises the question about code re-usability.

How much of what has been done in WPF/Prism can be adapted to work with a HTML5/JS front end?

We're thinking a majority of the code/classes can be moved to be what I would call the application service side of things that lives on the server.  The UI can be made out of HTML5/JS/Ajax etc.  But what we're missing obviously is the glue that holds the view layer on (command/input binding etc).

Is there an established and accepted approach to migrating to the web?

What about future Silverlight/Windows 8 RT versions?

I'm expecting to formulate a plan over the span of a few months.

Thanks in advance.


Feb 15, 2012 at 7:58 PM


In my opinion, so far there is no established approach regarding what’s the best choice to migrate to the web. This may vary depending on your personal preferences and the requirements of your scenario.

If what you are looking is to promote code re-usability, I believe migrating to Silverlight might be the recommended approach.

If this is your case, you could find the following section of the Prism documentation at MSDN interesting, where the main differences that have to be carefully considered when moving from one platform to the other are explained:

Additionally, if you are looking a guidance for building web applications that take advantage of the latest web standards like HTML5, I believe you may find Project Silk useful.


Agustin Adami

Feb 15, 2012 at 9:45 PM

Thanks for the reply, Agustin.

I'm familiar with Project Silk to the point of I've heard about it before.

We're hoping to bridge the gap between not using Silverlight (browser plugins are not acceptable) and still re-using our investment into our WPF/Prism codebase.

We are trying to avoid another ground up re-write with new architecture.