Gets or sets the image displayed by this ImageBrush.
Assembly: System.Windows (in System.Windows.dll)
Dependency property identifier field: ImageSourceProperty
The XAML usage for is significantly different than the code usage. The XAML usage uses a URI whereas the code usage uses an ImageSource. See "Setting ImageSource in XAML" section of this topic.
Cross-domain URIs are permitted (if permitted by configuration on the target server), and specifying the scheme is permitted, but mixing URI schemes (such as accessing an HTTPS image from a Silverlight plug-in hosted on an HTTP-served HTML page) is not permitted. For more information, see URL Access Restrictions in Silverlight.
Setting ImageSource in XAML
You can set this property in XAML, but in this case you are setting the property as a URI. This behavior relies on underlying type conversion that processes the string as a URI, and calls the BitmapImage(Uri) constructor. This in turn potentially requests a stream from that URI and returns the image source object.
The string provided for the property is interpreted as a Uniform Resource Identifier (URI). This is in contrast to an Internationalized Resource Identifier (IRI). This distinction means that characters used to identify a that are outside of US-ASCII will need to be encoded.
The format-specific filename extensions for the Silverlight supported image formats are not required to be in the URI naming. However, if the retrieved file is a valid image format when it is opened or processed, a runtime exception is thrown.
The ImageFailed event can occur if the initial attribute value in XAML does not specify a valid source.
You can use a relative URI to reference an image that you package with the application, or an absolute URI to reference an image from a server. For more information about how Silverlight processes URIs in general, and how relative URIs are interpreted according to your application model or resource structure, see Resource Files.
You can specify an initial XAML value of "" (empty string) and then set the value in script at a later time, to create a nonrendering placeholder.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.