none
.NET equivalent to getHost() ?

    Question

  • I'm probably just being stupid, but what is the .Net equivalent of Javascript's sender.getHost() ?

    Friday, May 04, 2007 3:21 PM

All replies

  • Hi m3taverse,

    I could be incorrect in this as I have not even attempted to compile this code, however, I believe the following can get you the host element:

    System.Windows.Browser.HtmlDocument d = new System.Windows.Browser.HtmlDocument();

    HtmlElement theHost = d.GetElementByID("silverlightControlID");

     or you may need to use the "SourceElement" property of a HtmlEventArgs variable.

    Thank you,

    Chad Campbell

    Friday, May 04, 2007 4:34 PM
  • I think you are looking for this:

    System.Windows.Interop.BrowserHost

     So you can do something like this:

    void btnFullScreen_MouseLeftButtonUp(object sender, MouseEventArgs e)

    {

    System.Windows.Interop.BrowserHost.IsFullScreen = true;

    }

     

    Friday, May 04, 2007 4:39 PM
  • thankyou both, that was very helpfull.

    Friday, May 04, 2007 5:39 PM