I have a problem with loading modules from a xaml file in the context of the prism library. The xaml for the modules look like this:
<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="WhenAvailable">
<Modularity:ModuleInfo Ref="file://HelloWorldModule.dll" ModuleName="HelloWorldModule" ModuleType="HelloWorldModule.Views.HelloWorldView, HelloWorldModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</Modularity:ModuleInfoGroup>
So far, the parser finds this xaml but it does not find the HelloWorldModule.dll. I could not find anything useful in the docs since these are all for Silverlight, but my project is a WFP app.
The relative path to the shell.exe is:
\Projects\QFX_Shell\bin\Debug
and the path to the HelloWorldModule.dll is:
\Projects\HelloWorldModule\bin\Debug
So the question is what value does the "Ref" attribute expect? Is it the absolute path for the HelloWorldModule.dll?
Second question is what value should the ModuleType attribute have:
namespace HelloWorldModule.Views
{
/// <summary>
/// Interaction logic for HelloWorldView.xaml
/// </summary>
public partial class HelloWorldView : UserControl
{
public HelloWorldView()
{
InitializeComponent();
}
}
}
Is the namespace included for the class type name?
ModuleType="HelloWorldModule.Views.HelloWorldView, HelloWorldModule...
Next question is, does the HelloWorldModule.dll to be in the same folder as the Shell.exe? Thanks, Juergen
For more advice about your questions, have a look at chapter 4, Modular Application Development of the Prism 4.0 - November 2010 manual.