IXRImage::AddImageFailedEventHandler (Windows Embedded CE 6.0)

1/6/2010

This method attaches a delegate to the ImageFailed event for this image. When the image raises the ImageFailed, this delegate will be invoked.

Syntax

virtual HRESULT STDMETHODCALLTYPE AddImageFailedEventHandler(
    IXRDelegate<XREventArgs>* pDelegate
)= 0;

Parameters

  • pDelegate
    [in] IXRDelegate<ArgType> object that you want to attach to the ImageFailed event, which is raised when there is an error associated with image retrieval or format.

    The CreateDelegate helper function provides an easy way to create this IXRDelegate object.

Return Value

Returns an HRESULT that indicates success or failure.

Returns XR_E_INVALID_OBJECT if pDelegate is not a Silverlight object.

Remarks

Conditions in which the ImageFailed event can occur include the following:

  • File not found.
  • Invalid (unrecognized or unsupported) file format.
  • Error decoding the file format after upload.

The ImageFailed event can occur if the initial Source attribute value in the source XAML does not specify a valid source, or if the value set by IXRImage::SetSource is an invalid source.

Multiple delegates can be attached to the same event.

To remove this delegate from the ImageFailed event, call IXRImage::RemoveImageFailedEventHandler.

.NET Framework Equivalent

None.

Requirements

Header XamlRuntime.h
sysgen SYSGEN_XAML_RUNTIME
Windows Embedded CE Windows Embedded CE 6.0 R3

See Also

Reference

IXRImage
XREventArgs

Concepts

Handle Events in Silverlight for Windows Embedded