views:

219

answers:

1

I'm using Prism in my WPF application and up to now, I've been loading the modules via var moduleCatalog = new ConfigurationModuleCatalog();. I'd like to get the module catalog from a database. The Prism documentation indicates that this is possible, but it doesn't go into any details.

Has anyone done this and can provide some guidance?

+1  A: 

This is a theoretical possibility, but it's not in any samples I've seen.

Basically what you'd do is either base64 encode the DLLs / Files into the database or zip them up and store them in one blob. You'd download them in your bootstrapper and copy them locally (in a temp directory) and then allows them to load normally from the filesystem using the DirectoryModuleCatalog. If you wanted it to be a bit more elegant, you could write your own ModuleCatalog that encapsulates this logic.

This is very similar to what I do... I actually download a zip file of all of the modules from a website at launch time and unzip them and load them with the DirectoryModuleCatalog.

Anderson Imes