Hosting Silverlight outside the browser (sourcecode)

Over half a year ago I blogged about a solution for hosting a Silverlight plugin outside the browser. This is not about the SL3 out-of-browser feature. This is a solution where the Silverlight plugin is hosted directly in your WinForm application without the need for a browser control. The demonstrated prototype included an implementation for Silverlight COM interfaces entirely written in C#. The prototype worked nicely and then nothing happened.

Fast forward 7 months; after reading Scott Hanselman's post on '32 Ways to Keep Your Blog from Sucking' I have decided to obey Hanselman's law #16: 'Have a Code Garage Sale'. It basically states that if you have code lying around and nothing happens with it, publish it.

So there you have it; the source code of a prototype Silverlight host that does not require a browser. The host is capable of displaying both single XAML pages and entire XAP packages, the included TestApp demonstrates both.

Please be aware that this is just a prototype; certain things just don't work. For example; you won't be able to type any text in a textbox in the XAML page example. There's probably a lot more to fix, but the source code should get you started. I am not available for any kind of support. You can try, but I'm probably too busy with other projects.

Download: AgHost source code.

 

 

 

 

2 Comments

Michael Washington said:

Wow thanks!

Casper van Dijk said:

Thanks for sharing that.. such code might create a whole new generation of 'Inside Ole' fans.