Windows.UI.Xaml.ExceptionRoutedEventArgs
June 22, 2022 ยท View on GitHub
-description
Provides event data for exceptions that are raised as events by asynchronous operations, such as ImageFailed.
-remarks
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 derived classes
ExceptionRoutedEventArgs is the parent class for MediaFailedRoutedEventArgs.
-examples
This example shows use of ExceptionRoutedEventArgs in a handler in order to get the HResult and error message.
[!code-csharpMediaPlayer_MediaFailedHandlers]