Gets a value that indicates the relative progress of downloaded content.
| XAML | Cannot be used in XAML. |
| Scripting | value = downloaderObject.DownloadProgress |
Property Value
Double
A value between 0 and 1 inclusive that represents the amount of total content downloaded. Multiply by 100 to obtain a percentage.
This property is read-only. The default value is 0.
Examples
The following JavaScript example shows how to use the DownloadProgress property in a DownloadProgressChanged event handler function:
| JavaScript |
// Event handler for updating visual progress indicator
function onDownloadProgressChanged(sender, eventArgs)
{
// Calculate the downloaded percentage.
var percentage = Math.floor(sender.downloadProgress * 100);
// Update the Rectangle and TextBlock objects of the visual progress indicator.
progressText.text = percentage + "%";
progressRectangle.width = percentage * 2;
}
|
The following illustration shows the visual progress indicator at the starting,
middle, and ending position of the download.
Visual progress indicator
A visual progress indicator can be constructed from a wide variety of XAML content, including animated objects.
Applies To
Downloader
See Also
Using a Downloader Object
DownloadProgressChanged
Send