module discovery /silverlight

Topics: Prism v4 - Silverlight 4
Oct 19, 2010 at 4:08 PM
Edited Oct 19, 2010 at 4:12 PM

Hello,

I’m trying to follow region navigation silverlight quick start and my next issue is how silverlight modules are discovered:

I had ModulesCatalog.xml within my main project

 

<Modularity:ModuleCatalog xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

                          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

                          xmlns:sys="clr-namespace:System;assembly=mscorlib"

                          xmlns:Modularity="clr-namespace:Microsoft.Practices.Prism.Modularity;assembly=Microsoft.Practices.Prism">

    <Modularity:ModuleInfoGroup Ref="OutOfOffice.Scheduler.xap" InitializationMode="WhenAvailable">

        <Modularity:ModuleInfo ModuleName="SchedulerModule"/>

    </Modularity:ModuleInfoGroup>   

</Modularity:ModuleCatalog>

 

In a bootstrapper there is an overridden CreateModuleCatalog() method :

protected override IModuleCatalog CreateModuleCatalog()

        {

            return

                Microsoft.Practices.Prism.Modularity.ModuleCatalog.CreateFromXaml(new Uri(ModuleCatalogUri,UriKind.Relative));

        }

 

Unfortunalty Initialize() in my module SchedulerModule  isn’t called.

 

 

If I put

this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof(OutOfOffice.Scheduler.SchedulerModule).Assembly));

within protected override void ConfigureAggregateCatalog() and add reference to module project in main project then module init is called.


The most annoying thing is tthat no exceptions are thrown.

What I’m missing?

Regards,

Boris

 

Oct 20, 2010 at 6:55 PM

Hi Boris,

Nice to see that you started using Prism Region Navigation Quickstart. Based on my understanding, you have created a new module (SchedulerModule), but your application is not able to load this. So, this causes that the Intialize method, located in the Module Initializer class, will not be called. So I think that you can find interesting the following forum thread where user reported a similar scenario:

Please, take into account that in the aforementioned thread the user tried to load its module on demand, so you could avoid the step 3 over there.

Hope this helps.

Fernando Antivero
http://blogs.southworks.net/fantivero