Checking out Prism from Patterns and Practices


 So Microsoft Prism is really interesting.

From a Silverlight standpoint it seems to do everything that I want it to do, or think that it should do. It doesn’t make a ViewModel “engine” thing, because ViewModels are simple easy to put together anyways. But what it does do, is handle decoupling of the application, a way to make a Silverlight “master page” I guess one could say, and it also allows you to use the ICommand pattern to really make your code separate (with the ICommand pattern it uses a “DelegateCommand” to register your event, like button click with a method…dead easy).

However, there are parts of the framework that are a little “janky.” For example, I need to have five references in every project. I need to have a shell application and then go back and manually add the modules to the module catalog whenever I create a new catalog.

Here are some things that I am pretty sure are required for Prism to work in your application (don’t quote me on this, I am writing this after work mind you):

1)      Create shells and modules

2)      The shell inherits from unitybootstrapper

3)      The shell wants to return a moduleCatalog and every module must be registered with this catalog

4)      Each module must have an IRegionManager pushed into the constructor (dependency injection)

5)      Each module must also have a unitycontainercontrolledlifetiemmanagertoolong crazy thing injected into the ctor

6)      Umm…I think that is it for setup and quirkiness.

 

I am just bitching for the most part for no reason because it looks like a solid effort and comes from Patterns and Practices anyway, so it can’t be bad right?

I need to make a video about these bits