当前位置: 代码迷 >> 综合 >> How to set a timer in wp7 applications?
  详细解决方案

How to set a timer in wp7 applications?

热度:51   发布时间:2023-12-15 18:21:44.0

How can I set a timer to run from code? I can't find any control named timer.

What are the steps needed to do this?

You're looking for the DispatcherTimer class.

DispatcherTimer dt = new DispatcherTimer();
dt.Interval = TimeSpan.FromSeconds(10);
dt.Tick += delegate { ... };
dt.Start();

  相关解决方案