WPF与siverlight通用的定时器

using System.Windows.Threading;


 DispatcherTimer timer = new DispatcherTimer();

 page_load{     

            timer.Interval = new TimeSpan(0, 0, 1);

            timer.Tick += new EventHandler(timer_Tick);

            timer.Start();

}


void timer_Tick(object sender, EventArgs e)
        {

// todo

}

你可能感兴趣的:(WPF与siverlight通用的定时器)