You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System;
|
|
|
|
|
using System.Windows.Threading;
|
|
|
|
|
|
|
|
|
|
namespace formula_manage.ViewModel
|
|
|
|
|
{
|
|
|
|
|
public class ExchangeViewModel : ViewModelBase
|
|
|
|
|
{
|
|
|
|
|
public ExchangeViewModel()
|
|
|
|
|
{
|
|
|
|
|
CountDown();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void CountDown()
|
|
|
|
|
{
|
|
|
|
|
DispatcherTimer timer = new DispatcherTimer//初始化循环,每0.5秒调用一次Tick_Event
|
|
|
|
|
{
|
|
|
|
|
Interval = TimeSpan.FromSeconds(0.5)
|
|
|
|
|
};
|
|
|
|
|
timer.Tick += Tick_Event;
|
|
|
|
|
timer.Start();
|
|
|
|
|
|
|
|
|
|
//设置定时器
|
|
|
|
|
// disTimer.Tick += new EventHandler(DisTimer_Tick);//每一秒执行的方法
|
|
|
|
|
// disTimer.Interval = new TimeSpan(10000000); //时间间隔为一秒。
|
|
|
|
|
// disTimer.Start();//计时开始
|
|
|
|
|
}
|
|
|
|
|
void Tick_Event(object sender, EventArgs e)//Tick_Event周期执行事件
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|