Click here to Skip to main content
15,905,323 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

i use the Microsoft.Toolkit.Uwp.Notifications package to handle Toast Notifications. Works well so far.
Now i want to have more control over the notifications - hiding / updating them.

Therefore i need e.g. the Class ToastNotificationHistoryCompat.

I want to use ToastNotificationHistoryCompat.Clear() for clearing all notifications of my app or ToastNotificationHistoryCompat.Remove("<tag>") for removing a special notification.

But i didn't have success so far.

I'm relatively new to C#, so probably i didn't understand some basics about class handling, so i beg your insulgance ;-)

Thank you + Best regards
Emanuel

What I have tried:

First i thought i have to handle it as an abstract class (without instance), so i tried
C#
public static ToastNotificationHistoryCompat tnh;
...
tnh.Clear();


But the error message told me that "he" expected an instance.
("Object reference not set to an instance of an object.")

So i tried
C#
ToastNotificationHistoryCompat tnh;
tnh.Clear();


Didn't work.

I tried to find a constructor (".new()"), but i have currently no idea how to handle the class ToastNotificationHistoryCompat and its methods.
Posted
Updated 7-Feb-22 11:44am

1 solution

Seems that i can get the History object with the ToastNotificationManagerCompat Class, Property "History"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900