Creating the Silverlight App Plugin

I want to know about common methods for dynamically loading content into a silverlight application. In particular, I want to create something like a widget-based application, where all GUI objects are small independent widgets. I want to provide static chrome, for example, a frame that hosts the actual widget that is downloaded from an external source, such as a website, or loaded by the user and displayed in this frame.

Questions:

  • What should a widget author do to upload his widget application to my application? I assume that I need to query the provided DLL for something like ViewModel and its DataTemplate, UserControl, or even an XAP file. What would be best? The external widget must also implement a specific interface so that the external application can call methods such as Loaded and Unloaded on it. Small code samples will be appreciated.

  • How about security? How can I prevent an internal widget application from accessing my external application. I think the widget application can go into the control tree or access the DataContext of my frame control by hosting the application. This is problem? If so, how to solve it?

Thanks in advance! Andrew

+4
source share
1 answer

You can dynamically load controls from DLLs that your widget developers could provide, MS Mike Tauti made a walkthrough .

Microsoft also has Prism , which allows you to break your Silverlight code in a modular way. I have not tried to find out if this is suitable for loading individual controls, but my impressions of what I read about it seem to indicate that it has a basis for this.

In terms of security, they will have access to the rest of the application, so this may not be suitable.

+3
source

All Articles