Where is timer in a Windows store app?

后端 未结 2 1777
小鲜肉
小鲜肉 2020-12-06 09:44

I could not find the Timer when developing a Windows Store App in c#. What is the alternative /new name/way of use of it?

2条回答
  •  时光说笑
    2020-12-06 10:50

    DispatcherTimer is what you are looking for

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

提交回复
热议问题