Chapter 4. Working with HTML and browsers

 

This chapter covers

  • Interacting with the HTML Document Object Model
  • Scripting Silverlight with JavaScript
  • Hosting HTML in Silverlight

Silverlight has always been a web technology, integrated into the web page. Even when a Silverlight application took over the entire browser client area, it was still contained within several layers of HTML tags. Given the history, it makes sense that a Silverlight plug-in would have complete access to the Document Object Model (DOM) on the page in which it resides. In fact, the access is so complete that a Silverlight application could take over all of the functionality normally provided by JavaScript if you wanted to go that route.

Silverlight 4 added the ability for Silverlight to host HTML within itself when running in out-of-browser mode. Silverlight 5 expanded that to support hosting an HTML browser when running inside the browser. The integration is provided by the default browsing engine in the OS and supports some script integration.

This chapter starts where Silverlight started, in the browser, where it can take advantage of the DOM. From there, I’ll drill deeper into the HTML DOM and discuss the embedded Silverlight control. This control, also known as the Silverlight plug-in, ultimately hosts your Silverlight content. Finally, I’ll move on to hosting HTML within your Silverlight application.

4.1. Silverlight and the HTML DOM

 
 

4.2. Working with the web page from managed code

 
 
 

4.3. Working with the hosting browser window

 
 

4.4. Bridging the scripting and managed code worlds

 

4.5. Hosting HTML in Silverlight

 
 
 

4.6. Summary

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest