SL3:Is it possible to embed one Silverlight app into another one

367 Views Asked by At

Subject line pretty much describes my question.

Can I embed one Silverlight app into another one and make them communicate with each other (like pass parameters back and forth?)

3

There are 3 best solutions below

0
On BEST ANSWER

Ended up using MEF for this purpose.

1
On

Any Silverlight project compiles down to a DLL, and a Silverlight DLL can load other Silverlight DLLs. So essentially, yes, you can reference another Silverlight application by treating it as a library. This will allow you to instantiate its classes, call methods on those classes, and so forth. That's not quite the same thing you're asking, but it's pretty close, and it would probably allow you to do what you need to do.

One thing to be aware of is that there's only one Application.Current, and so the only App.xaml that gets loaded is the very first one. If you have resources defined in your contained application's app.xaml, you'll need to redefine those resources in the containing application's app.xaml.

1
On

Like Ken said, not possible in the pure sense of an application within an application.

My question to you is why? Perhaps that might help us to understand what you are doing and better answer how to do what you want to do.

As you can communicate between two Silverlight Apps running in the same client. Look up "LocalMessageSender" and "LocalMessageReceiver" under System.Windows.Messaging.