ToastNotification.Failed Event

Definition

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