ToastNotification.Failed 事件

定義

發生于 Windows 嘗試引發快顯通知時發生錯誤。 執行的應用程式會訂閱此事件。

// 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) 

事件類型

備註

快顯通知失敗的原因可以在ToastFailedEventArgs參數的ErrorCode屬性中找到。

引發快顯通知時會看到最常見的失敗是 設定 錯誤,例如此使用者的快顯通知區塊。 建議您先呼叫 ToastNotifier.Setting ,再呼叫 Show ,而不是透過此事件處理該情況。

適用於

另請參閱