WaferHolderBuffer.xaml.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  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.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace CyberX8_Themes.UserControls
  18. {
  19. /// <summary>
  20. /// WaferHolderBuffer.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class WaferHolderBuffer : UserControl, INotifyPropertyChanged
  23. {
  24. public WaferHolderBuffer()
  25. {
  26. InitializeComponent();
  27. }
  28. private string _cellName;
  29. public string CellName
  30. {
  31. get { return _cellName; }
  32. set
  33. {
  34. _cellName=value;
  35. InvokePropertyChanged(nameof(CellName));
  36. }
  37. }
  38. private bool _isWHEnable = true;
  39. public bool IsWHEnable
  40. {
  41. get { return _isWHEnable; }
  42. set
  43. {
  44. _isWHEnable = value;
  45. InvokePropertyChanged(nameof(IsWHEnable));
  46. }
  47. }
  48. private bool _waferHolderVisible = false;
  49. public bool WaferHolderVisible
  50. {
  51. get { return _waferHolderVisible; }
  52. set
  53. {
  54. _waferHolderVisible = value;
  55. InvokePropertyChanged(nameof(WaferHolderVisible));
  56. }
  57. }
  58. public event PropertyChangedEventHandler PropertyChanged;
  59. private void InvokePropertyChanged(string propertyName)
  60. {
  61. if (PropertyChanged != null)
  62. {
  63. PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
  64. }
  65. }
  66. }
  67. internal class ProcessingColorConverter : IValueConverter
  68. {
  69. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  70. {
  71. int cellStatus=(int)value;
  72. return cellStatus==(int)CellStatus.Busy ? new SolidColorBrush(Colors.Lime) :(cellStatus==(int)CellStatus.Idle? new SolidColorBrush(Colors.Transparent):new SolidColorBrush(Colors.DarkGray));
  73. }
  74. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  75. {
  76. throw new NotImplementedException();
  77. }
  78. }
  79. }