Share via


IXRImageBrush::AddImageFailedEventHandler (Compact 2013)

3/28/2014

This method attaches a delegate to the ImageFailed event for this image brush. When the ImageFailed event is raised by this image brush, this delegate will be invoked.

Syntax

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

Parameters

  • pDelegate
    [in] IXRDelegate<ArgType, [SenderType]> object that you want to attach to the ImageFailed event, which occurs when there is an error associated with image retrieval or image 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 XAML for Windows Embedded object.

Remarks

Conditions that can trigger the ImageFailed event include the following:

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

The ImageFailed event can occur if the initial source attribute value in the source XAML or the value set by IXRImageBrush::SetImageSource is invalid.

Multiple delegates can be attached to the same event.

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

.NET Framework Equivalent

None.

Requirements

Header

XamlRuntime.h,
XRDelegate.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRImageBrush
XREventArgs