终端一体化运控平台
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.
 
 
 

39 line
1.1 KiB

  1. global using Microsoft.Toolkit.Mvvm.ComponentModel;
  2. using BPASmartClient.Helper;
  3. using BPASmartClient.Model;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.IO;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. namespace BPASmartClient.MilkWithTea.ViewModel
  11. {
  12. public class MainWindowVeiwModel : ObservableObject
  13. {
  14. public bool AutoStart { get { return SystemHelper.GetInstance.IsAutoStart(); } set { SystemHelper.GetInstance.AutoStart(value); OnPropertyChanged(); } }
  15. public MainWindowVeiwModel()
  16. {
  17. Json<JsonLocalRecipes>.Read();
  18. Json<JsonDeviceConfig>.Read();
  19. if (Json<JsonLocalRecipes>.Data.localMaterails.Count<14)
  20. {
  21. Json<JsonLocalRecipes>.Data.localMaterails.Clear();
  22. for (int i = 1; i < 15; i++)
  23. {
  24. Json<JsonLocalRecipes>.Data.localMaterails.Add(new LocalMaterail
  25. {
  26. MaterialID = Guid.NewGuid().ToString(),
  27. MaterialPosition = i
  28. });;
  29. }
  30. }
  31. }
  32. }
  33. }