2

My Silverlight PRISM application is loading several XAP modules. I want to be able to get access to the types contained in the loaded modules so I could create instances of the views and modelviews BEFORE shell is activated. I am trying to implement something like this:

                AggregateCatalog.Changed+=(o, e)=>
                                          {
                                              var type =
                                                  Type.GetType(
                                                      "mytype, assemblyname");
}

but the type is always null :( Please help.

grimcoder
  • 87
  • 6
  • .. by the time you call `Type.GetType()`, did you make sure that the module in which this type is defined has been loaded? also, please write the actual string in the method you're calling. – Nawaz Dec 04 '10 at 07:11
  • Yes, I am actually trying to get type from the e.AddedExports – grimcoder Dec 05 '10 at 00:38
  • I found what was the problem - imported part was not composed - i.e. but after I explicitely triggered Container.ComposeParts(this) it started picking up the typed correctly. – grimcoder Dec 05 '10 at 00:42
  • yeah, MEF is a nice container but takes time to learn .... – grimcoder Dec 05 '10 at 00:42

0 Answers0