我有一个 DispatcherTimer 我已经像这样初始化了:
static DispatcherTimer _timer = new DispatcherTimer();
static void Main()
{
_timer.Interval = new TimeSpan(0, 0, 5);
_timer.Tick += new EventHandler(_timer_Tick);
_timer.Start();
}
static void _timer_Tick(object sender, EventArgs e)
{
//do something
}
_timer_Tick 事件永远不会被触发,我错过了什么吗?