Click here to Skip to main content
15,878,809 members
Articles / Silverlight
Tip/Trick

Dynamic module loading in Prism (CAL)

Rate me:
Please Sign up or sign in to vote.
3.00/5 (2 votes)
4 Jun 2010CPOL1 min read 26.6K   6   6
Dynamic module loading in Prism (CAL)
While using Microsoft Prism with a Silverlight application, we need not download all modules at the client together. This can be done on demand (as the client navigates to that particular module via the application).

The first two steps are described well in the Prism documentation available on msdn. I have just mentioned them for completeness here.

1) Set the copy local for assemblies that are included in other project to false.

2) Create a ModulesCatalog using a xaml file or use code behind.

3) A third step (undocumented) that I figured out after spending some time debugging Prism code (when steps 1 and 2 were not working for me) was to make sure that the Generate Silverlight manifest file checkbox is checked in the project’s properties. By project, I mean the project that is going to be loaded dynamically at runtime. Also, do not change the name of the Manifest file template. Let it continue to be called AppManifest.xml.

For those interested, code with the reference to the AppManifest.xml file can be found in the XapModuleTypeLoader class (in the Prism source code). If this value is not set, the Prism code steps out before loading the module.

Cheers

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
India India

Comments and Discussions

 
Question[My vote of 1] ROFL ONLY A GOAT HUMPER WITH A UNIT INCHER WOULD VOTE 5 FOR THIS CRAPOLA ARTICLE Pin
Member 140734168-Dec-18 2:39
Member 140734168-Dec-18 2:39 
GeneralReason for my vote of 5 maxa Pin
kasunsm.kt29-Aug-11 18:25
kasunsm.kt29-Aug-11 18:25 
GeneralRe: Thanks. Pin
Abhinav S31-Aug-11 19:05
Abhinav S31-Aug-11 19:05 
GeneralRe: Reason for my vote of 5maxa Pin
Member 140734168-Dec-18 2:40
Member 140734168-Dec-18 2:40 
GeneralLinks Pin
Brady Kelly1-Jan-10 19:40
Brady Kelly1-Jan-10 19:40 
GeneralRe: Links Pin
Abhinav S1-Jan-10 20:08
Abhinav S1-Jan-10 20:08 
Thanks for mentioning this. A link to the CAL library (Prism) has been added.

There are only 10 types of people in this world — those who understand binary, and those who don't.

modified on Saturday, January 2, 2010 6:54 AM

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.