System.Windows.Threading.DispatcherTimer _timer = new System.Windows.Threading.DispatcherTimer();
_timer.Interval = new TimeSpan(0, 0, 0, 0,10);
_timer.Tick += new EventHandler(theout);
_timer.Start();
public void theout(object source, EventArgs e)
{
}
定时在界面上修改显示信息,当定时器的时间间隔小于50ms时,如果使用System.Timers.Timer 就会大概率出现显示错误,间隔越小概率越大,原因是WPF是单线程的图形操作。