views:

73

answers:

1

Let's say I have the following Silverlight Applications:

  1. App1.xap
  2. App2.xap
  3. App3.xap

Let's say that I start App1.xap as the default xap file. If I load App2.xap and App3.xap and instantiate an Application class within one of the other two XAPs. The Application.Current changes to be that new instance.

System.Windows.Application obj = Activator.CreateInstance(type) as System.Windows.Application;

I don't want the current application to change. I just want to get the merged Resource Dictionaries off the Application class.

A: 

Would it not be simpler to just share the resource dictionaries and then compile the resources into each xap file? It seems this approach makes it a lot more complicated than it requires it to be.

Ray Booysen
Resource dictionaries will only pass XAML content not classes and this approach would tightly couple that content to every XAP. If we load the assemblies using reflection, you only need to implement and maintain interfaces for the classes that you load and use.
markti