6 changed files with 121 additions and 27 deletions
@ -1,6 +1,14 @@ |
|||||
<?xml version="1.0" encoding="utf-8" ?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<configuration> |
<configuration> |
||||
<startup> |
<startup> |
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /> |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /> |
||||
</startup> |
</startup> |
||||
|
<runtime> |
||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> |
||||
|
<dependentAssembly> |
||||
|
<assemblyIdentity name="Xceed.Wpf.AvalonDock" publicKeyToken="3e4669d2f30244f4" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" /> |
||||
|
</dependentAssembly> |
||||
|
</assemblyBinding> |
||||
|
</runtime> |
||||
</configuration> |
</configuration> |
||||
@ -0,0 +1,63 @@ |
|||||
|
using formula_manage.SQLModels; |
||||
|
using formula_manage.Windows; |
||||
|
using GalaSoft.MvvmLight; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text; |
||||
|
using System.Threading.Tasks; |
||||
|
using System.Windows.Threading; |
||||
|
|
||||
|
namespace formula_manage.ViewModel |
||||
|
{ |
||||
|
///<Summary>
|
||||
|
/// StuffViewModel
|
||||
|
///</Summary>
|
||||
|
public class StuffViewModel : ViewModelBase |
||||
|
{ |
||||
|
private List<Product> products = new List<Product>(); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 所有原料
|
||||
|
/// </summary>
|
||||
|
public List<Product> Product |
||||
|
{ |
||||
|
get |
||||
|
{ |
||||
|
return products; |
||||
|
} |
||||
|
set |
||||
|
{ |
||||
|
products = value; |
||||
|
RaisePropertyChanged(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// StuffViewModeldl
|
||||
|
/// </summary>
|
||||
|
public StuffViewModel() |
||||
|
{ |
||||
|
//products = new ProductProvider().Select();
|
||||
|
DispatcherTimer timer = new DispatcherTimer//初始化循环,每0.5秒调用一次Tick_Event
|
||||
|
{ |
||||
|
Interval = TimeSpan.FromSeconds(0.1) |
||||
|
}; |
||||
|
timer.Tick += Tick_Event; |
||||
|
timer.Start(); |
||||
|
} |
||||
|
|
||||
|
void Tick_Event(object sender, EventArgs e)//Tick_Event周期执行事件
|
||||
|
{ |
||||
|
if (Stuff.Button_sql == true)//获取按钮状态
|
||||
|
{ |
||||
|
// if (Stuff.Buttontype_sql == -1) Product = new ProductProvider().Select();
|
||||
|
// if (Stuff.Buttontype_sql == 0) Product = new ProductProvider().Selects0();
|
||||
|
// if (Stuff.Buttontype_sql == 1) Product = new ProductProvider().Selects1();
|
||||
|
// if (Stuff.Buttontype_sql == 2) Product = new ProductProvider().Selects2();
|
||||
|
// if (Stuff.Buttontype_sql == 3) Product = new ProductProvider().Selects3();
|
||||
|
Stuff.Button_sql = false;//清除按钮状态
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -1,6 +1,8 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<packages> |
<packages> |
||||
<package id="Extended.Wpf.Toolkit" version="3.5.0" targetFramework="net46" /> |
<package id="CommonServiceLocator" version="2.0.2" targetFramework="net46" /> |
||||
|
<package id="Extended.Wpf.Toolkit" version="4.5.1" targetFramework="net46" /> |
||||
<package id="ModernUI.WPF" version="1.0.9" targetFramework="net46" /> |
<package id="ModernUI.WPF" version="1.0.9" targetFramework="net46" /> |
||||
|
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net46" /> |
||||
<package id="SamOatesGames.ModernUI.Xceed.Toolkit" version="1.0.1905191936" targetFramework="net46" /> |
<package id="SamOatesGames.ModernUI.Xceed.Toolkit" version="1.0.1905191936" targetFramework="net46" /> |
||||
</packages> |
</packages> |
||||
Loading…
Reference in new issue