Browser Integration
Silverlight 2 is a web browser-hosted control that runs in Internet Explorer, Firefox 2, and Safari or Firefox on the Macintosh. As such, there will be scenarios where developers need to customize how the control is configured. There will also be cases where developers need to modify the web browser Document Object Model (DOM) from Silverlight as well as situations where developers need to modify the Silverlight application from the DOM.
■ Note Any performance or functionality differences that appeared among Firefox, Safari, and Internet Explorer during Silverlight 2 beta testing were considered bugs by Microsoft.
In Chapter 2, which focuses on the basics of the Silverlight programming model, we included recipes related to interacting with the browser:
• Recipe 2-3, Using the FindName Method
• Recipe 2-4, Dynamically Loading XAML from JavaScript
Recipe 2-3 demonstrates how to use FindName fromJavaScript to locate and manipulateXAML elements from JavaScript. Recipe 2-4 implements JavaScript that creates a piece ofXAML and attaches it to the Silverlight controlVisualTree. Refer to those recipes for more information.
In this chapter we cover how to customize the Silverlight 2 control within the browser. We also explain how to interact with the web browser DOM to provide a fully integrated web browsing experience.
Post a comment