There are two ways to access the Silverlight plug-in. One is to use
the HTML DOM and the document.getElementById()
method, and provide the ID used in the createSilverlight()
function. The other is to intercept any Silverlight event and access the
plug-in in the following
fashion:
function eventHandler(sender, eventArgs) { var plugin = sender.getHost(); }
From the plug-in, you have access to the following properties and methods:
content.accessibility
Accessibility information of the Silverlight content (read-only).
content.actualHeight
content.actualWidth
content.createFromXaml(xamlContent,
nameScope)
Creates a Silverlight object with the given XAML content;
if nameScope
is set to true
,
a unique x:Name
attribute is assigned.
content.createFromXamlDownloader(downloader,
part)
Creates a Silverlight object from the given
downloader object; if the downloaded content is a ZIP archive,
part
defines the name of the file to use.
content.findName(objectName)
content.fullScreen
Whether the Silverlight plug-in is in full-screen mode (read and write).
content.onFullScreenChange
Event handler that is fired when the application enters or leaves full-screen mode.
content.onResize
Event handler that is fired if the Silverlight content area is resized.
createObject(objectType)
initParams
The initialization parameters provided for the Silverlight content (read-only after the initialization).
isLoaded
Whether the Silverlight plug-in and its XAML content are fully loaded (read-only).
isVersionSupported(versionString)
Whether the current Silverlight plug-in supports content with the given version number.
onError
Event handler that is fired if an error occurs within the Silverlight application.
root
settings.background
The background color of the Silverlight content area (read and write).
settings.enabledFramerateCounter
Whether the current frame rate is displayed in the browser’s status bar (read and write; note that not all browsers allow you to change the content of the status bar).
settings.enableRedrawRegions
Whether the regions of the Silverlight content that are redrawn are highlighted (read and write; useful only during development).
settings.enableHtmlAccess
Whether to allow Silverlight content to access the HTML DOM (read-only).
settings.maxFrameRate
The maximum frame rate (number of frames) of the Silverlight content (read and write).
settings.windowless
Whether the Silverlight application runs in windowless mode (then the background may use alphatransparency and can let the background on the HTML page shine through), set in the initialization phase (read-only afterward).
source
The XAML source code of the Silverlight content (read and write).