title: Prism Module doesn't get initialized
body: <p>I am creating a application with Prism and Unity. I use the <code>DirectoryModuleCatalog</code> to load several modules from disk which are displayed in a main menu and when you click on the name of this particular module the UI of this module gets loaded.
  Each module is designed according to the MVVM model, so with a separate view and view model.</p>
  
  <p>Bootstrapper:</p>
  
  <pre><code>class Bootstrapper : UnityBootstrapper
  {
     protected override DependencyObject CreateShell()
     {
          Shell shell = Container.Resolve&lt;Shell&gt;();
          shell.Show();
          return shell;
     }
  
     protected override void InitializeShell()
     {
          base.InitializeShell();
          App.Current.MainWindow = (Window)this.Shell;
          App.Current.MainWindow.Show();
     }
  
     protected override void ConfigureContainer()
     {
         base.ConfigureContainer();
         Container.RegisterType&lt;IApplicationMenuRegistry, MenuRegistry&gt;();
         Container.RegisterType&lt;IApplicationCommands, ApplicationCommands&gt;();
         Container.RegisterType&lt;ShellViewModel, ShellViewModel&gt;(new Microsoft.Practices.Unity.ContainerControlledLifetimeManager());
  
         //****** When I uncomment following line, the HelloWorldModule2 doesn't get initialized ***********
         // Container.RegisterType&lt;HelloWorldModule2ViewModel, HelloWorldModule2ViewModel&gt;(new Microsoft.Practices.Unity.ContainerControlledLifetimeManager());
      }
  
  
      protected override IModuleCatalog  CreateModuleCatalog()
      {
          return new DirectoryModuleCatalog() { ModulePath = @"C:\Data\NPC Service Tool\Source\develop\POC\GUIWithPrism\Modules" };
  
      }
  }
  </code></pre>
  
  <p>Module:</p>
  
  <pre><code>namespace HelloWorldModule2
  {
      [Module(ModuleName="HelloWorldModule2")]
      public class HelloWorldModule2 : IModule
      {
          private IApplicationMenuRegistry menuRegistry;
          private HelloWorldModule2ViewModel viewModel;
          private IRegionManager regionManager;
          public HelloWorldModule2(IApplicationMenuRegistry menuRegistry, HelloWorldModule2ViewModel vm, IRegionManager regionManager)
          {
              this.menuRegistry = menuRegistry;
              this.regionManager = regionManager;
              this.viewModel = vm;
          }
  
          public void Initialize()
          {
              ObservableCollection&lt;ViewObject&gt; views = new ObservableCollection&lt;ViewObject&gt;();
              views.Add(new ViewObject() { Region = RegionName.Right, ViewType = typeof(HelloWorld2View) });
              views.Add(new ViewObject() { Region = RegionName.Left, ViewType = typeof(View2) }); 
  
              //****** Here the module gets registered in the main menu ******//
              menuRegistry.RegisterModuleMenuItem("HelloWorld2", "Hello World module 2",views,1);
              this.viewModel.Title = "Hello world module 2";
          }
      }
  }
  </code></pre>
  
  <p>View Model:</p>
  
  <pre><code>namespace HelloWorldModule2.ViewModels
  {
      public class HelloWorldModule2ViewModel : NotificationObject
      {
          private string title;
  
          public string Title
          {
              get { return title; }
              set
              {
                  title = value;
                  RaisePropertyChanged(() =&gt; this.Title);
              }
          }
      }
  }
  </code></pre>
  
  <p>I ran into the following problem: 
  When i register the view model in the Unity container as seen in the Bootstrapper code, my module doesn't get initialized (I set a breakpoint in the <code>Initialize</code> method of the module but it never
  hits). If I remove the registration and remove the vm parameter in the constructor of the module, the module DOES initialize.</p>
  
  <p>Also when i manual configure the module catalog with this module with:</p>
  
  <pre><code>protected override void ConfigureModuleCatalog()
  {
     base.ConfigureModuleCatalog();
     ModuleCatalog moduleCatalog = (ModuleCatalog)this.ModuleCatalog;
     moduleCatalog.AddModule(typeof(HelloWorldModule2.HelloWorldModule2));
  }
  </code></pre>
  
  <p>instead of the <code>DirectoryModuleCatalog</code>, it initializes correctly even WITH the registration of the view model.</p>