OnFullScreenChange Event

Occurs whenever the FullScreen property of the Silverlight plug-in changes.

Scripting (Instantiation)
Cannot add handlers during instantiation
Scripting (Runtime)
silverlightObject.onFullScreenChange = functionName

Event Handler Parameters

sender

object

Identifies the object that invoked the event (the Silverlight plug-in).

eventArgs

object

This parameter is always set to null.

Remarks

The OnFullScreenChange event occurs whenever the Silverlight plug-in changes between embedded mode and full-screen mode:

  • embedded mode: plug-in displays within the Web browser.
  • full-screen mode: plug-in displays on top of all other applications.

When the Silverlight plug-in displays in embedded mode, the plug-in is contained within the browser window. When the Silverlight plug-in displays in full-screen mode, the plug-in resizes to the current resolution of the display and overlays all other applications, including the browser. The following illustration show the differences between embedded mode and full-screen mode.

Silverlight plug-in displaying as embedded and full-screen mode

Silverlight plug-in displaying as embedded and full-screen mode

Note   Silverlight does not support automatic layout of elements. This means that applications have to provide logic to resize themselves appropriately when the plugin's size changes.

Examples

The following JavaScript example shows how to define a OnFullScreenChange event for a Silverlight plug-in.

JavaScript
var plugin;
function onLoaded(sender, args)
{
    // Retrieve a reference to the plug-in.
    plugin = sender.getHost();
    // Set the event handler function for the OnFullScreenChange event.
    plugin.content.onFullScreenChange = onFullScreenChanged;
    // Do initial layout of the app based on initial size.
    updateLayout(plugin.content.actualWidth, plugin.content.actualHeight);
}
function onFullScreenChanged(sender, eventArgs)
{
    // Do layout resizing of the app whenever the FullScreen property changes.
    updateLayout(plugin.content.actualWidth, plugin.content.actualHeight);
}
// Resize and reposition application elements.
function updateLayout(width, height)
{
    // Perform layout tasks based on width and height.
}

Applies To

Silverlight Plug-in

See Also

Silverlight Full Screen Support
Resizing a Silverlight Plug-in
ActualHeight
ActualWidth
OnResize