SetSource Method

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Sets the source value of an object with downloaded content.

XAML
You cannot use methods in XAML.
Scripting

object.setSource(downloader)

Parameters

downloader Downloader

The object containing the downloaded content.

Return Value

None

Remarks

The SetSource method can be used as a way of setting downloaded content to the Source property of the Image and MediaElement objects, or the ImageSource property of the ImageBrush object. The following JavaScript example shows how to use the SetSource method to set the Source property of an Image object to the downloaded content:

JavaScript
// Event handler for the Completed event.
function onCompleted(sender, eventArgs)
{
    // Retrieve the Image object.
    var myImage = sender.findName("myImage");
    // Set the Source property to the contents of the downloaded object.
    myImage.setSource(sender);
}

Applies To

Image, ImageBrush, MediaElement

See Also

Downloader, Using a Downloader Object