SelectStrockerViewModel.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using CommunityToolkit.Mvvm.Input;
  2. using DataVM.DataTypes.Status;
  3. using System.Windows.Media;
  4. using UICommon.DataType;
  5. using UICommon.Helper;
  6. namespace SummaryModule.Dialogs.ViewModels;
  7. internal partial class SelectStrockerViewModel : ObservableObject, IDialogAware
  8. {
  9. public DialogCloseListener RequestClose { get; }
  10. [ObservableProperty]
  11. private string? _Title = "Select Stocker";
  12. [ObservableProperty]
  13. private ImageSource? _ImageSource;
  14. [ObservableProperty]
  15. private ObservableDictionary<int, Wafer>? _Wafer;
  16. public bool CanCloseDialog()
  17. {
  18. return true;
  19. }
  20. public void OnDialogClosed()
  21. {
  22. }
  23. public void OnDialogOpened(IDialogParameters parameters)
  24. {
  25. this.Wafer = [];
  26. for (int i = 25; i > 0; i--)
  27. {
  28. Wafer wafer = new()
  29. {
  30. Slot = i,
  31. WaferInfo = $"Stocker1.{i}",
  32. WaferType = "P1"
  33. };
  34. Wafer.Add(i, wafer);
  35. }
  36. }
  37. [RelayCommand]
  38. private void Close()
  39. {
  40. this.RequestClose.Invoke();
  41. }
  42. }