I have an application in which the user is able to create different notifications, like sticky notes and set their starting times. When he presses the start button a timer starts and these reminders should pop up at the time they were set for. I've searched for other answers, like this one, but the problem here is the notifications' times are different.
So what is the best way to schedule the events that activate the notifications? I can think of two possible ways with their Pros and Cons:
Run a
DispatcherTimer
, that ticks every second and checks whether the time for a notification has come and pop it up. Pros: singleDispatcherTimer
instance. Cons: ticking every second and checking all notifications is an overhead.Create a
DispatcherTimer
for each notification and let them handle time themselves. Pros: every timer ticks just once to pop the notification. Cons: too many timers is an overhead and may be hard to control.
Am I on the right track? Which of the two approaches is better, resource wise? Is there a third better way I am overlooking?
EDIT: If it makes any difference, the notifications should also auto close after some user-defined time and repeat at regular user-defined intervals.