终端一体化运控平台
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

72 righe
2.0 KiB

  1. using System;
  2. using System.Globalization;
  3. using System.Windows.Data;
  4. namespace BPASmartClient.FoodStationTest.Converter
  5. {
  6. public class RunStatusConvert : IValueConverter
  7. {
  8. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  9. {
  10. if (value is ushort tempValue)
  11. {
  12. if (tempValue == 1)
  13. return "等待配料";
  14. if (tempValue == 2)
  15. return "配料中";
  16. if (tempValue == 3)
  17. return "配料完成";
  18. }
  19. return "等待配料";
  20. }
  21. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  22. {
  23. throw new NotImplementedException();
  24. }
  25. }
  26. public class EnbleConvert : IValueConverter
  27. {
  28. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  29. {
  30. if (value is ushort tempValue)
  31. {
  32. if (tempValue == 0)
  33. return true;
  34. if (tempValue == 1)
  35. return false;
  36. }
  37. return true;
  38. }
  39. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  40. {
  41. throw new NotImplementedException();
  42. }
  43. }
  44. public class IntToSourceConvert : IValueConverter
  45. {
  46. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  47. {
  48. if (value is ushort tempValue)
  49. {
  50. if (tempValue == 0)
  51. return "本地原料";
  52. if (tempValue == 1)
  53. return "设备原料";
  54. }
  55. return "未知";
  56. }
  57. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  58. {
  59. throw new NotImplementedException();
  60. }
  61. }
  62. }