N2PurgeSelectorViewModel.cs 944 B

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