Silverlight contains some columns that can imitate Dom classes in HTML. These classes allow Silverlight to interact with HTML elements on the same interface. For example, read the value of a control, update a text value, or add a new element to the HTML page. These classes are all in the namespace system. Windows. Brower. There are several important classes below
Htmlpage
HtmlpageRepresents the entire HTML page hosted by Silverlight, which is the starting point of interaction with HTML. It provides HTML interaction (document attribute), browser Information Retrieval (browserinfo attribute), interaction with the current browser window (Windows attribute), and registration of the Silverlight method (registercreateabletype () that allows JavaScript to call () and registerscriptabletyp () method).
Browserinformation
Provide some information about how to run SilverlightProgramBrowser information, including the browser name, version, and operating system. You can use the htmlpage. browserinfomattion attribute to obtain an instance of the browserinfomation class.
Htmldocument
Htmldocument represents a complete HTML document. You can use the htmlpage. Document attribute to obtain an htmldocument instance that represents the current HTML page. You can use the htmldocument object to explore the structure and content of the page (including embedded elements of the htmlelement object ).
Htmlelement
Htmlelement can represent HTML elements in a page. You can use methods like setattribute () and setproperty () to operate these elements. Generally, the htmlelement object is obtained in the htmldocument object.
Htmlwindow
Htmlwindow represents a browser window, and provides some methods to jump to a new interface or to different parts of the same page. Generally, the htmlpage. Window attribute is used to obtain the htmlwindow class instance of the Silverlight host page.
Httputility
Httputility is a number of HTML-related tasks, including HTML encoding and decoding (making the text securely displayed on the page), URL encoding, and decoding (making the strings in the URL safe-for example, as a query string ).
Scriptabletypeattribute and scriptablememberattribute
These two classes allow you to expose some classes and methods that can be accessed by HTML Javascript in Silverlight.
Scriptobject
Scriptobject represents the JavaScript function defined on the page and allows this method to be called in the Silverlight program.