In WebBrowser control get Silverlight Canvas

Posted by darren on Stack Overflow See other posts from Stack Overflow or by darren
Published on 2010-03-16T16:35:32Z Indexed on 2010/03/18 14:51 UTC
Read the original article Hit count: 705

I have a webbrowser control that loads an html page which contains a silverlight object.

I want to use the webbrowser control to get the silverlight canvas so that I can pass it to a WriteableBitmap() object.

The silverlight is being loaded into a div called SilverlightHostControl and I am trying to get it like this in C#:

object element = webBrowser.Document.GetElementById("SilverlightControlHost");

This returns a {System.Windows.Forms.HtmlElement} which contains the silverlight object but I don't know how to get the Silverlight object so I can use it the WriteableBitmap() object.

© Stack Overflow or respective owner

Related posts about silverlight-3.0

Related posts about webbrowser-control