Windows商店应用中的计时器在哪里?

在c#中开发Windowsapp store应用时,我找不到Timer。 它的替代/新名称/使用方式是什么?

针对不同需求的不同计时器。 大致…

DispatcherTimer – 当您希望在UI线程上执行工作时。

ThreadPoolTimer – 当您希望在后台线程上执行工作时。

DispatcherTimer是您正在寻找的

 var timer = new DispatcherTimer(); timer.Tick += DispatcherTimerEventHandler; timer.Interval = new TimeSpan(0,0,0,1); timer.Start();