How can I attach a Silverlight OOB to a Winforms panel?

Posted by JohnMcCon on Stack Overflow See other posts from Stack Overflow or by JohnMcCon
Published on 2010-03-29T19:27:45Z Indexed on 2010/03/29 19:33 UTC
Read the original article Hit count: 624

Summary:

I want the prettiness of Silverlight/WPF in part of my current Winforms application. The application can only have access to the full .NET Framework 2.0, no more and no less. The only possibility I can think of is a Silverlight OOB application that utilizes Com+ Automation but I can't figure out how to attach the Silverlight application to a panel within the parent Winforms application.

Details:

I currently have a winforms application, and want to take advantage of the improved GUI features in WPF but to many of my users are still running .Net Framework 2.0 and refuse to update to 3+. So WPF is not an option for me.

I know Silverlight is just a subset of WPF, but it has most of the features I'm looking for and only requires the Silverlight plug-in. I've read about Silverlight 4's Com+ Automation, which would give me access to the full desktop .Net Framework 2.0 (which I need). In order for Com+ Automation to work in Silverlight I need elevated trust and the only way I can find to gain elevated trust is to make my Silverlight application Out-Of-Browser (OOB).

My problem is that the OOB application seems to run in its own container window and I need the Silverlight application embedded inside a panel in my Winforms application. My Winforms application does not need to communicate with the Silverlight application and vice-versa, this is purely to have everything contained and displayed in one window.

If there is another way to get my desired result that I have not thought of feel free to suggest it.

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about silverlight-oob