Occurs when a download request completes with content.
| XAML | Cannot be used in XAML. |
| Scripting |
[token = ]downloaderObject.AddEventListener("Completed", eventhandlerFunction)
|
AddEventListener Parameters
| downloaderObject | object A particular Downloader object. |
| token | integer A token that is returned from the function, which you can optionally retain as a variable. If you intend to call RemoveEventListener to remove the handler, you will need this token. |
| eventhandlerFunction | object The name of your event handler function as it is defined in script. When used as an AddEventListener parameter, quotes around the function name are not required. See Remarks. |
Event Handler Parameters
| sender | object Identifies the object that invoked the event. |
| eventArgs | object This parameter is always set to null. |
Examples
The following JavaScript example shows how to define a Completed event handler function that accesses the downloaded content, in this case a single content item download (not a package):
| JavaScript |
// Event handler for the Completed event.
function onCompleted(sender, eventArgs)
{
// Retrieve downloaded XAML content.
var xamlFragment = sender.ResponseText;
// Create the objects from the XAML content.
var plugin = sender.getHost();
var button = plugin.content.createFromXaml(xamlFragment);
// Add downloaded XAML content to the root Canvas of the plug-in.
var rootCanvas = sender.findName("rootCanvas");
rootCanvas.children.add(button);
}
|
Applies To
Downloader
See Also
Using a Downloader Object
DownloadProgressChanged
Status
StatusText