Defining Module dependency in ModulesCatalog.xaml

Nov 27, 2008 at 1:45 PM
Hi all,

I have created an xaml file (ModulesCatalog) that is then used in my bootstrapper to build the module catalog. This way :
protected override IModuleCatalog GetModuleCatalog()
    return ModuleCatalogBuilder.CreateFromXaml(new Uri("/TestUI;component/ModulesCatalog.xaml", UriKind.Relative)).GetCatalog();

Now, I would like to define module dependencies in this file. Can someone tell me how do I do that ?
I'm also interested in knowing how to do the same thing with C#. I probably missed something but I could not find how in the quickstarts.

Thank you,
Nov 27, 2008 at 4:03 PM
Edited Nov 27, 2008 at 4:07 PM

Quick starts do contain a sample demo of GetModuleCatalog/CreateFromXaml approach. Did you take a look of RemoteModuleLoading sample? I believe this sample is using the concept  and probably will help you futher.
Also "Composite Application Guidance for WPF and Silverlight.chm" file is usefull and contains a lot of info of how to create module dependencies. Its located in root of  the code drop 6 directory. 

Nov 27, 2008 at 5:36 PM
Edited Nov 28, 2008 at 11:48 AM

Hi Jeff,


In the current Prism-v2 drop (Drop 6), there is not out of the box support to define dependencies between modules in the ModuleCatalog, because the setter of the DependsOn property is private. The modularity approach is being reviewed by the team and will probably have some changes in the next drops.


As for defining dependencies between modules using C# you could use code similar to this:

protected override IModuleCatalog GetModuleCatalog()


                                ModuleCatalog catalog = new ModuleCatalog();


                new ModuleInfoGroup { InitializationMode = InitializationMode.WithApp }

                    .AddModule(typeof(ModuleA), "ModuleB")



            return catalog;



For more information about how to dynamically load modules and define dependencies between them you can check these in the latest Prism-v2 drop (Drop 6):

·         How to: Build a Modules Catalog (in the documentation)

·         Static Module Loading QuickStart (in code dependency)

·         Remote Module Loading QuickStart (ModuleCatalog dependency)


Please let me know if this helps.


Damian Schenkelman