简体   繁体   中英

Windows Phone timed repeating method (like NSTimer in IOS)

Is there anytihng in WP7.5 like NSTimer in iOS where I can set a method to call once, or repeatedly at a set interval.

Many Thanks, -Code

System.Windows.Threading.DispatcherTimer dt = new System.Windows.Threading.DispatcherTimer();

dt.Interval = TimeSpan.FromMilliseconds(500);
dt.Tick +=new EventHandler(dt_Tick);

void dt_Tick(object sender, EventArgs e)
{
       //code
}

and

dt.start() ;

dt.stop() ;

Depending on what you're trying to do, you'll want to use:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM