Building an OS with Silverlight+PRISM

So after a long time coming, I have finally fallen for PRISM. I am working with a customer to build a highly extensible presentation layer platform that will accomplish the following goals:

  1. Speed Time-to-Market
  2. Lower UI Development Costs

We are achieving these goals by of course leveraging Silverlight as our development platform but more importantly leveraging PRISM and Unity to build the underlying extensible architecture.

Our solution consists of a Desktop Application that contains the main shell and boot strapper. Then each “application” is implemented as a module that can be loaded into this shell. We define a couple standard regions within the desktop to provide for standardized branding and place-holders for application specific menus and commands such as full-screen, configure, and close.

image

We then built a couple behaviors that handle execution of these application modules. The first is the single instance behavior which will check to see if the application module is currently running and will switch the window manager to that application.

image

Next we built a multi-instance behavior that will just execute the application no questions asked. In doing this, the complexity increases quite a bit as we need to track application and “session” (I’m using this term loosely). There is another wrench that gets thrown into the work here as well. Since our application modules have their own shell and their own regions when we load multiple instances of them we need to make sure that we use scoped region managers otherwise PRISM will throw the following exception: “Region with the given name is already registered”. This article on MSDN provides a very concise (and accurate) guide on how to leverage scoped region managers.

image

With this approach we will eventually be able to deploy applications to the “desktop” through an administrative application module that allows users to upload a XAP file, icon, application title and description.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s