Chapter 4. Working with HTML and browsers
This chapter covers
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.