|
|
@ -44,18 +44,18 @@ namespace Audit.ViewModel |
|
|
{ |
|
|
{ |
|
|
products = new ProductProvider().Select(); |
|
|
products = new ProductProvider().Select(); |
|
|
DispatcherTimer timer = new DispatcherTimer();//每0.5秒调用一次Tick_Event
|
|
|
DispatcherTimer timer = new DispatcherTimer();//每0.5秒调用一次Tick_Event
|
|
|
timer.Interval = TimeSpan.FromSeconds(0.5); |
|
|
timer.Interval = TimeSpan.FromSeconds(0.1); |
|
|
timer.Tick += Tick_Event; |
|
|
timer.Tick += Tick_Event; |
|
|
timer.Start(); |
|
|
timer.Start(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void Tick_Event(object sender, EventArgs e) |
|
|
void Tick_Event(object sender, EventArgs e)//Tick_Event周期执行事件
|
|
|
{ |
|
|
{ |
|
|
if (StuffView.Button_sql == true) |
|
|
if (StuffView.Button_sql == true)//获取按钮状态
|
|
|
{ |
|
|
{ |
|
|
Product = new ProductProvider().Select(); |
|
|
Product = new ProductProvider().Select();//扫描数据库
|
|
|
StuffView.Button_sql = false; |
|
|
StuffView.Button_sql = false;//清除按钮状态
|
|
|
}//扫描数据库
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|