语言

AppNotificationManager.NotificationInvoked 活动

定义

通过用户交互调用应用的应用通知时引发。

注释

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 之前注册此事件的处理程序。 否则,将启动一个新进程来处理调用。

适用于

另请参阅