我正在使用 C# 和 XAML 在 Windows 10 通用版中进行推送通知。一切正常。当我收到通知并且应用程序正在运行时,我会在通知到来时使用此功能做一些事情。
private async void Channel_PushNotificationReceived(PushNotificationChannel sender, PushNotificationReceivedEventArgs e)
{
e.Cancel = true;
//do something in reaction to the notification
}
但是当应用程序在后台时,我会收到一个徽章形式的 toast 通知。当我单击该应用程序打开到它所在的最后一页时。但是,我想要做的是,当单击徽章时,我希望能够在我的代码中调用一个函数。我该怎么做呢?