ToastNotification.Failed 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
当 Windows 尝试引发 Toast 通知时导致错误时发生。 运行的应用订阅此事件。
// 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)
事件类型
注解
Toast 失败的原因可以在 ToastFailedEventArgs 参数的 ErrorCode 属性中找到。
引发 Toast 时,最常见的失败是 设置 错误,例如此用户的 Toast 通知上出现块。 建议在调用 Show 之前调用 ToastNotifier.Setting,而不是通过此事件处理这种情况。
适用于
另请参阅
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈