What is the best way to create a module for both WPF and Silverlight

Dec 7, 2008 at 7:27 PM
Edited Dec 7, 2008 at 7:29 PM
Hello,

1.

I've learnt that there are four ways of loading modules in Prism. Those are ~

- statically load modules
- remote downloading
- configuration
- directory lookup

I would like to create a module for both WPF and Silverlight without having strong-reference. (so, static module loading is out of picture). I'm thinking to use remote downloading or configuration or directory lookup but AFAIK, remoting downloading is only for Silverlight and config/dir lookup are for WPF.. So, I'm not sure what would be the best way to create a module that can work for both Silverlight and WPF.

2.  In doc of Prism v3 drop7, I found the line below in "How to Prepare a Module for Remote Downloading " section.

>>You have to add an AssemblyPart element tag for every dynamic link library file that your solution contains or references.

2.1. Do I really need to add each and every dlls that I referenced in my project? OR my solution (OMG)?

<Modularity:ModuleDeployment
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Modularity="clr-namespace:Microsoft.Practices.Composite.Modularity;assembly=Microsoft.Practices.Composite.Silverlight">
    <Modularity:ModuleDeployment.Parts>
        <AssemblyPart Source="Microsoft.Practices.Composite.Presentation.Silverlight.dll"/>
        <AssemblyPart Source="Microsoft.Practices.Composite.Silverlight.dll"/>
        <AssemblyPart Source="Microsoft.Practices.Composite.UnityExtensions.Silverlight.dll"/>        
        <AssemblyPart Source="blah blah blah"/>        

    </Modularity:ModuleDeployment.Parts>
</Modularity:ModuleDeployment>
2.2. Do I need to add System Assembly (e.g. mscorlib or System.Xml or etc) ?? 
3. Do I have to use Silverlight Application Project Template to create a module? Can I use Silverlight Class Template to create the module so that I don't need to delete the App.xaml, Page.xaml, Properties\AppManifest.xml manually?



Dec 8, 2008 at 11:27 PM
I will answer my own question. :)
1.

I'm using remote downloading for SL and config for WPF for now.

2. No. The doc is not correct or clear.

2.2. No. It's because you still need to generate xap in webproject.