N2PurgeSelectorViewModel.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using CommunityToolkit.Mvvm.Input;
  2. using System.Windows.Media;
  3. namespace SummaryModule.Pops.N2Purge;
  4. partial class N2PurgeSelectorViewModel : ObservableObject, IDialogAware
  5. {
  6. public ImageSource? ImageSource { get; set; } = (DrawingImage)Application.Current.Resources["Icon_N2_Purge"];
  7. public string? Title { get; set; } = "Sequence Select";
  8. public DialogCloseListener RequestClose { get; }
  9. public bool CanClose()
  10. {
  11. return true;
  12. }
  13. public void OnClose()
  14. {
  15. }
  16. public void OnPop(object? state)
  17. {
  18. this.Mode = "N2 Purge Mode";
  19. }
  20. [ObservableProperty]
  21. private string? _Mode;
  22. [RelayCommand]
  23. private void Switch(string para)
  24. {
  25. this.Mode = para;
  26. }
  27. [RelayCommand]
  28. private void Apply()
  29. {
  30. this.RequestClose.Invoke();
  31. }
  32. public bool CanCloseDialog()
  33. {
  34. return true;
  35. }
  36. public void OnDialogClosed()
  37. {
  38. }
  39. public void OnDialogOpened(IDialogParameters parameters)
  40. {
  41. }
  42. }