O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Image Element

Image enables images of multiple formats to be rendered: BMP, PNG, GIF, JPEG, JPEG-XR, TIFF, and even ICO files. It has a Source property of type ImageSource, but thanks to a type converter, you can set the property to a simple string in XAML, as in this example:

<Image Source="Assets/Logo.png"/>

Source can point to an image file packaged with your app (a resource), a local file, or an image from the Web. The content is fetched and processed asynchronously, so a slow network connection doesn’t impact your app’s responsiveness. When Source is set, it results in either an ImageOpened event being raised on success, or an ImageFailed event being raised on failure. In the latter case, the Image element ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required