IXRImage::AddImageFailedEventHandler (Compact 2013)
3/28/2014
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, [SenderType]> 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 XAML for Windows Embedded 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 |