TempValueSetViewModel.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using MECF.Framework.UI.Client.CenterViews.Dialogs;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using FurnaceUI.Models;
  9. namespace FurnaceUI.Views.Editors
  10. {
  11. public class TempValueSetViewModel : FurnaceUIViewModelBase
  12. {
  13. public bool IsEnable => CGlobal.RecipeProcessEditViewEnable;//是否是View模式
  14. private string _tempSetValue;
  15. public string TempSetValue
  16. {
  17. get => _tempSetValue; set
  18. {
  19. _tempSetValue = value;
  20. NotifyOfPropertyChange("TempSetValue");
  21. }
  22. }
  23. public bool IsBagValue { get; set; }
  24. private int _tempMaxValue;
  25. public int TempMaxValue
  26. {
  27. get => _tempMaxValue; set
  28. {
  29. _tempMaxValue = value;
  30. NotifyOfPropertyChange("TempMaxValue");
  31. }
  32. }
  33. private int _tempMinValue;
  34. public int TempMinValue
  35. {
  36. get => _tempMinValue; set
  37. {
  38. _tempMinValue = value;
  39. NotifyOfPropertyChange("TempMinValue");
  40. }
  41. }
  42. public void SetTemperatureMaxValueCmd(string operate, object sender)
  43. {
  44. if (operate == "UP")
  45. {
  46. TempMaxValue += 10;
  47. }
  48. else if (operate == "DOWN")
  49. {
  50. TempMaxValue -= 10;
  51. }
  52. }
  53. public void SetTemperatureMinValueCmd(string operate, object sender)
  54. {
  55. if (operate == "UP")
  56. {
  57. TempMinValue += 10;
  58. }
  59. else if (operate == "DOWN")
  60. {
  61. TempMinValue -= 10;
  62. }
  63. }
  64. public void SetTemperatureValueCmd(object sender)
  65. {
  66. //NumberKeyboard numberKeyboard = new NumberKeyboard("Set Temperature Value", TempSetValue.ToString());
  67. //if ((bool)numberKeyboard.ShowDialog())
  68. //{
  69. // TempSetValue = float.Parse(numberKeyboard.ValueString);
  70. //}
  71. }
  72. public void SaveCmd()
  73. {
  74. ((Window)GetView()).DialogResult=true;
  75. }
  76. public void CloseCmd()
  77. {
  78. ((Window)GetView()).DialogResult=false;
  79. }
  80. }
  81. }