79336884

Date: 2025-01-07 17:46:53
Score: 1
Natty:
Report link

Does normal timer not work? If I understand correctly, Dispatcher is something that ment to be working with UI thread, thus once your application has UI thread suspended (going into background) it stops working.

I would first suggest using typical timer:

System.Timers.Timer timer = new Timer{TimeSpan.FromSeconds(1).ToMilliseconds};
timer.Elapsed += (s, e) => {
//cancel activities
}
timer.Start();

There should also be some option to autorestart it.

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: aw3