Unexpected Behavior of Toast Notifications for win

2019-06-02 22:06发布

问题:

I am adding Toast Notifications to my desktop application and experiencing strange behavior of Action Center in Windows 10

Observed Behavior:

  • Toast Notifications does not appear in Action Center after time out
  • Toast Notifications appear in action center when you click on the action center button during the toast display,but it disappears as
    soon as you close the action center

Expected Behavior:

  • Toast notifications should appear in Action Center after time out
  • Toast notification should still be there after closing and opening of action center

Can some one please tell me if this is the defined behavior of Toast Notifications in windows 10 as Microsoft Outlook Toast Notifications behave the same way too.

回答1:

This was answered on https://stackoverflow.com/a/34072291/3836163

Win32 apps need to set up a COM server in order to have toasts persisted in Action Center: https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/send-local-toast-desktop