Toast notification in WPF: ToastNotificationManager.History throws an exception win10

1

With a lot of limitations, I manage to pop toast notifications in WPF thanks to instructions given below.

https://www.michaelcrump.net/pop-toast-notification-in-wpf/

Unfortunately, I didn't proceed very much with that with extending the code. I tried to get the history of the Notifications

       ToastNotificationManager.History.GetHistory();

But it keeps throwing an exception as follow:

       Element not found. (Exception from HRESULT: 0x80070490);

Can you please give me some hint?

Regards, Reza

c#
wpf
asked on Stack Overflow Sep 3, 2019 by Reza

1 Answer

0

Follow the below link and scroll right to the bottom.

https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/modernize-wpf-tutorial-4

Notice the error code is the same as yours.

As it says, this is because you haven't registered a package identity for your app.

If I recall correctly, once you register an identity then you only get authority to do things with notifications your app raised.

answered on Stack Overflow Sep 3, 2019 by Andy

User contributions licensed under CC BY-SA 3.0