Merge branch 'master' of http://scddns.f3322.net:13000/sc/Audit_APP
This commit is contained in:
commit
7118885ffe
3 files changed
+31
-8
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using GalaSoft.MvvmLight;
|
||||
using Audit.View;
|
||||
using GalaSoft.MvvmLight;
|
||||
using Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -42,15 +43,19 @@ namespace Audit.ViewModel
|
||||
public StuffViewModel()
|
||||
{
|
||||
products = new ProductProvider().Select();
|
||||
DispatcherTimer timer = new DispatcherTimer();//每5秒调用一次Tick_Event
|
||||
timer.Interval = TimeSpan.FromSeconds(5);
|
||||
DispatcherTimer timer = new DispatcherTimer();//每0.5秒调用一次Tick_Event
|
||||
timer.Interval = TimeSpan.FromSeconds(0.5);
|
||||
timer.Tick += Tick_Event;
|
||||
timer.Start();
|
||||
}
|
||||
|
||||
void Tick_Event(object sender, EventArgs e)
|
||||
{
|
||||
Product = new ProductProvider().Select();//扫描数据库
|
||||
if (StuffView.Button_sql == true)
|
||||
{
|
||||
Product = new ProductProvider().Select();
|
||||
StuffView.Button_sql = false;
|
||||
}//扫描数据库
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user