-api-id | -api-type |
---|---|
T:Windows.UI.Xaml.ExceptionRoutedEventArgs |
winrt class |
Provides event data for exceptions that are raised as events by asynchronous operations, such as ImageFailed.
Don't display ErrorMessage strings to end users. Instead, use substrings and codes within the string to positively identify the error condition, and have your app take appropriate action or display user-appropriate information in the app UI.
ExceptionRoutedEventArgs is the event data for several events that use the ExceptionRoutedEventHandler delegate. These include:
- Image.ImageFailed
- ImageBrush.ImageFailed
- BitmapImage.ImageFailed
- MediaElement.MediaFailed; for this event you can cast the event data to the more specific MediaFailedRoutedEventArgs result.
ExceptionRoutedEventArgs is the parent class for MediaFailedRoutedEventArgs.
This example shows use of ExceptionRoutedEventArgs in a handler in order to get the HResult and error message.
[!code-csharpMediaPlayer_MediaFailedHandlers]