Condividi tramite


OnSourceDownloadComplete (Silverlight Plug-in Object)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the name of the event handler that is called when the source download has finished.

Syntax

object Element

<object ...>
  <param name="onsourcedownloadcomplete" value="functionname"/>
  ...
</object>

Silverlight.js

Not implemented in the functions.

JavaScript

Do not use; use the object parameter as the handler attachment point.

COM

IXcpControl::OnSourceDownloadComplete

Managed Code

Not available.

Property Value

The name of the function that is invoked when the source download has finished. The default value is null.

Remarks

The event reports download completion for the package that has been requested through the Source property.

The most typical scenario for noting download completion is to display a message in an area of the hosting HTML page (not in the splash screen). The splash-screen XAML page has reached the end of its lifetime when the event occurs. Therefore, it does not make sense to report download completion in the splash screen.

Any JavaScript code for the splash screen (including event handlers that are referenced by this property) must be made in a script block or in an included script file that is referenced from the hosting HTML page.

If you are referencing a Source that is cross-domain from the hosting HTML, handlers for OnSourceDownloadComplete or OnSourceDownloadProgressChanged are never invoked. Therefore you can only display indeterminate splash screens if loading source cross-domain. The hosting HTML may wish to assign a handler for OnLoad in this case, as it is the best available object lifetime event for resetting state after the source XAP loads.

For more information about how to work with splash screens, see Silverlight Splash Screens.

Arguments for an OnSourceDownloadCompleted Function

sender

object

The Silverlight plug-in that raised the event.

args

Always null.