Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

New Post: How to create a separate XAP file using Prism/MEFBootstrapper for a complex Child Window?

$
0
0

Hello,

I have spent some time reading articles/references and reviewing your advice. What you said about exporting the two classes as type ChildWindow makes sense. For now I will use Show() for the ChildWindows, but, I am definitely interested in the InteractionNotificationRequest approach after I get the basic module flows working.

I have some additional questions.

  1. If I understand the intent, importing each child window class into the SharedFormsModule class makes it available for use by the importing class in the main application shell. Is this correct?
  2. IModule requires an instance of Initialize(). Is this method blank or does it require some additional code?
  3. I am using a customized version of the Silverlight Navigation project as my application template. I would like to add the module code on demand. What do I have to do in the shell (e.g., a Home page or some other page) to access the module from a page since it is not being used as a region? All the explanations/examples that I have found only deal with regions.

I have created a ModulesCatalog.xaml as follows:

<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 InitializationMode="OnDemand">
  <Modularity:ModuleInfo Ref="SharedForms.xap"
          ModuleName="SharedFormsModule"
          ModuleType="SharedForms.SharedFormsModule, SharedForms, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
 </Modularity:ModuleInfoGroup>
</Modularity:ModuleCatalog> 

The bootstrapper appears to be working properly. The shell is being created by the bootstrapper, and the modules catalog is being created/returned in the following code.

protected override IModuleCatalog CreateModuleCatalog()
{
 var moduleCatalog = Modularity.ModuleCatalog.CreateFromXaml(new Uri("/SMMApp;component/ModulesCatalog.xaml", UriKind.Relative));
 return moduleCatalog;
}

I am missing the steps to get/use the module child window code in one of the pages of the shell.

Thanks, Warren


Viewing all articles
Browse latest Browse all 1878