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

69 line
2.4 KiB

  1. using BPA.Message.Enum;
  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. using System.Windows.Media;
  11. namespace BPASmartClient.CustomResource.Converters
  12. {
  13. public class ColorConverter : IValueConverter
  14. {
  15. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  16. {
  17. SolidColorBrush returnValue = new SolidColorBrush(Color.FromArgb(255, 0, 204, 255));
  18. switch ((ORDER_STATUS)value)
  19. {
  20. case ORDER_STATUS.WAIT:
  21. returnValue = new SolidColorBrush(Color.FromArgb(255, 0, 204, 255));
  22. break;
  23. case ORDER_STATUS.COOKING:
  24. returnValue = new SolidColorBrush(Color.FromArgb(255, 0, 255, 127));
  25. break;
  26. case ORDER_STATUS.COMPLETED_COOK:
  27. returnValue = new SolidColorBrush(Color.FromArgb(255, 255, 215, 00));
  28. break;
  29. case ORDER_STATUS.COMPLETED_TAKE:
  30. returnValue = new SolidColorBrush(Color.FromArgb(255, 102, 204, 153));
  31. break;
  32. case ORDER_STATUS.ERR_NOT_REPLY_WHEN_COOKING:
  33. returnValue = new SolidColorBrush(Color.FromArgb(180, 180, 180, 180));
  34. break;
  35. case ORDER_STATUS.UNABLE_COOK:
  36. returnValue = new SolidColorBrush(Color.FromRgb(247, 156,154));
  37. break;
  38. default:
  39. break;
  40. }
  41. return returnValue;
  42. }
  43. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  44. {
  45. throw new NotImplementedException();
  46. }
  47. }
  48. public class VisibleConvert : IValueConverter
  49. {
  50. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  51. {
  52. switch ((ORDER_STATUS)value)
  53. {
  54. case ORDER_STATUS.WAIT:
  55. return Visibility.Visible;
  56. default:
  57. return Visibility.Collapsed;
  58. }
  59. }
  60. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  61. {
  62. throw new NotImplementedException();
  63. }
  64. }
  65. }