.NET Framework Class Library for Silverlight
HtmlWindow Class

Provides the managed representation of the JavaScript window object.

Namespace:  System.Windows.Browser
Assembly:  System.Windows.Browser (in System.Windows.Browser.dll)
Syntax

Visual Basic (Declaration)
Public NotInheritable Class HtmlWindow _
    Inherits HtmlObject
Visual Basic (Usage)
Dim instance As HtmlWindow
C#
public sealed class HtmlWindow : HtmlObject
Remarks

When the Silverlight plug-in's enableHtmlAccess property is set to false, any attempt to use the HtmlWindow class fails with a NotSupportedException stating that the feature is disabled.

For information about the JavaScript window object, see the window object in the dynamic HTML (DHTML) documentation.

For information about the enableHtmlAccess property, see Security Settings in HTML Bridge.

If you are using Safari version 2 or 3 on a Macintosh computer, comparing two or more managed HtmlWindow references that point to the same Document Object Model (DOM) window reference returns false.

Examples

The following example accesses a page that has one IFRAME. HTML Bridge methods are used to get two references to the IFRAME.

HtmlWindow htmlWin1  = HtmlPage.Window;
HtmlWindow htmlWin2  = HtmlPage.Window;

The following comparison returns false on Safari 2 or 3 on a Macintosh computer:

bool areEqual = (htmlWin1== htmlWin2);
Inheritance Hierarchy

System..::.Object
  System.Windows.Browser..::.ScriptObject
    System.Windows.Browser..::.HtmlObject
      System.Windows.Browser..::.HtmlWindow
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference

Tags :


Page view tracker