How to set a timer in wp7 applications?

来源:互联网 发布:免费手机文档编辑软件 编辑:程序博客网 时间:2024/06/14 13:06

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();