|
|
|
@ -9,6 +9,7 @@ using System.Threading.Tasks; |
|
|
|
using System.Web.Services.Description; |
|
|
|
using System.Windows.Controls; |
|
|
|
using System.Windows.Data; |
|
|
|
using System.Windows.Threading; |
|
|
|
|
|
|
|
namespace Audit.ViewModel |
|
|
|
{ |
|
|
|
@ -36,11 +37,20 @@ namespace Audit.ViewModel |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 查询数据
|
|
|
|
/// StuffViewModeldl
|
|
|
|
/// </summary>
|
|
|
|
public StuffViewModel() |
|
|
|
{ |
|
|
|
products = new ProductProvider().Select(); |
|
|
|
DispatcherTimer timer = new DispatcherTimer();//每5秒调用一次Tick_Event
|
|
|
|
timer.Interval = TimeSpan.FromSeconds(5); |
|
|
|
timer.Tick += Tick_Event; |
|
|
|
timer.Start(); |
|
|
|
} |
|
|
|
|
|
|
|
void Tick_Event(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
Product = new ProductProvider().Select();//扫描数据库
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|