终端一体化运控平台
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 

128 рядки
4.3 KiB

  1. using BPASmartClient.Model.大炒;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Globalization;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Data;
  10. namespace BPASmartClient.MorkBF.Convert
  11. {
  12. public class StirToVisibilityConverter : IValueConverter
  13. {
  14. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  15. {
  16. Visibility visibility = Visibility.Visible;
  17. if (value != null && value is FryAction fryAction)
  18. {
  19. switch (fryAction)
  20. {
  21. case FryAction.冷锅加热:
  22. visibility = Visibility.Collapsed;
  23. break;
  24. case FryAction.热油:
  25. visibility = Visibility.Visible;
  26. break;
  27. case FryAction.机器人加调料:
  28. visibility = Visibility.Collapsed;
  29. break;
  30. case FryAction.通道出调料:
  31. visibility = Visibility.Collapsed;
  32. break;
  33. case FryAction.炒制菜品:
  34. visibility = Visibility.Visible;
  35. break;
  36. default:
  37. break;
  38. }
  39. }
  40. return visibility;
  41. }
  42. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  43. {
  44. throw new NotImplementedException();
  45. }
  46. }
  47. public class FirePositionToVisibilityConverter : IValueConverter
  48. {
  49. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  50. {
  51. Visibility visibility = Visibility.Visible;
  52. if (value != null && value is FryAction fryAction)
  53. {
  54. switch (fryAction)
  55. {
  56. case FryAction.冷锅加热:
  57. visibility = Visibility.Visible;
  58. break;
  59. case FryAction.热油:
  60. visibility = Visibility.Visible;
  61. break;
  62. case FryAction.机器人加调料:
  63. visibility = Visibility.Collapsed;
  64. break;
  65. case FryAction.通道出调料:
  66. visibility = Visibility.Collapsed;
  67. break;
  68. case FryAction.炒制菜品:
  69. visibility = Visibility.Visible;
  70. break;
  71. default:
  72. break;
  73. }
  74. }
  75. return visibility;
  76. }
  77. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  78. {
  79. throw new NotImplementedException();
  80. }
  81. }
  82. public class AccessoriesToVisibilityConverter : IValueConverter
  83. {
  84. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  85. {
  86. Visibility visibility = Visibility.Visible;
  87. if (value != null && value is FryAction fryAction)
  88. {
  89. switch (fryAction)
  90. {
  91. case FryAction.冷锅加热:
  92. visibility = Visibility.Collapsed;
  93. break;
  94. case FryAction.热油:
  95. visibility = Visibility.Collapsed;
  96. break;
  97. case FryAction.机器人加调料:
  98. visibility = Visibility.Visible;
  99. break;
  100. case FryAction.通道出调料:
  101. visibility = Visibility.Visible;
  102. break;
  103. case FryAction.炒制菜品:
  104. visibility = Visibility.Visible;
  105. break;
  106. default:
  107. break;
  108. }
  109. }
  110. return visibility;
  111. }
  112. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  113. {
  114. throw new NotImplementedException();
  115. }
  116. }
  117. }