AppNotificationManager.NotificationInvoked 事件
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
當使用者互動觸發應用程式通知時,會被提升。
Note
AppNotificationManager 類別依賴 Singleton 套件。 因為這種依賴性,如果你從 自包含的應用程式呼叫這些 API,有幾點需要注意。 欲了解更多資訊與細節,請參閱 「附加 MSIX 套件的相依關係」。
// Register
event_token NotificationInvoked(TypedEventHandler<AppNotificationManager, AppNotificationActivatedEventArgs const&> const& handler) const;
// Revoke with event_token
void NotificationInvoked(event_token const* cookie) const;
// Revoke with event_revoker
AppNotificationManager::NotificationInvoked_revoker NotificationInvoked(auto_revoke_t, TypedEventHandler<AppNotificationManager, AppNotificationActivatedEventArgs const&> const& handler) const;
public event TypedEventHandler<AppNotificationManager,AppNotificationActivatedEventArgs> NotificationInvoked;
function onNotificationInvoked(eventArgs) { /* Your code */ }
appNotificationManager.addEventListener("notificationinvoked", onNotificationInvoked);
appNotificationManager.removeEventListener("notificationinvoked", onNotificationInvoked);
- or -
appNotificationManager.onnotificationinvoked = onNotificationInvoked;
Public Custom Event NotificationInvoked As TypedEventHandler(Of AppNotificationManager, AppNotificationActivatedEventArgs)
事件類型
備註
為確保 NotificationInvoked 事件處理程序在執行中的應用程式程序中被呼叫,請在呼叫 Register 前先註冊該事件的處理程序。 否則,將啟動一個新的程序來處理這個召喚。