ToastNotification.Failed Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs when an error is caused when Windows attempts to raise a toast notification. Apps that are running subscribe to this event.
// Register
event_token Failed(TypedEventHandler<ToastNotification, ToastFailedEventArgs const&> const& handler) const;
// Revoke with event_token
void Failed(event_token const* cookie) const;
// Revoke with event_revoker
ToastNotification::Failed_revoker Failed(auto_revoke_t, TypedEventHandler<ToastNotification, ToastFailedEventArgs const&> const& handler) const;
public event TypedEventHandler<ToastNotification,ToastFailedEventArgs> Failed;
function onFailed(eventArgs) { /* Your code */ }
toastNotification.addEventListener("failed", onFailed);
toastNotification.removeEventListener("failed", onFailed);
- or -
toastNotification.onfailed = onFailed;
Public Custom Event Failed As TypedEventHandler(Of ToastNotification, ToastFailedEventArgs)
Event Type
Remarks
The reason for the toast's failure can be found in the ErrorCode property of the ToastFailedEventArgs parameter.
The most common failure that you'll see when you raise a toast is a settings error, for instance a block on toast notifications for this user. We recommend that you call ToastNotifier.Setting before you call Show instead of handling that situation through this event.
Applies to
See also
- ToastFailedEventArgs
- Toast notifications sample
- Sending toast notifications from desktop apps sample
- Toast XML schema
- Tiles, badges, and notifications
- Quickstart: Sending a toast notification
- Quickstart: Sending a toast push notification
- Quickstart: Sending a toast notification from the desktop
- Guidelines and checklist for toast notifications
- How to handle activation from a toast notification
- How to opt in for toast notifications
- How to schedule a toast notification
- How to enable desktop toast notifications through an AppUserModelID
- The toast template catalog
- Toast audio options