How can I attach a Silverlight OOB to a Winforms panel?
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 pl开发者_运维问答ug-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.
The best option is to host the Silverlight content within a WebBrowser Control. This will allow your Silverlight content to run "inside" your windows forms application.
The COM automation won't help for embedded silverlight INTO a Windows Forms application. It's really intended for using COM from within Silverlight, not the other way around.
精彩评论