AxisBoolViewModel.cs 712 B

123456789101112131415161718192021222324252627282930313233343536
  1. using MaintainModule.ViewModels;
  2. using System.Collections.ObjectModel;
  3. using System.Windows.Media;
  4. namespace MaintainModule.Pops;
  5. internal partial class AxisBoolViewModel : ObservableObject, IPopAware
  6. {
  7. public ImageSource? ImageSource { get; set; }
  8. public Action? RequestClose { get; set; }
  9. public string? Title { get; set; }
  10. [ObservableProperty]
  11. private AxisSetting<int>? _DataSource;
  12. public bool CanClose()
  13. {
  14. return true;
  15. }
  16. public void OnClose()
  17. {
  18. }
  19. public void OnPop(object? state)
  20. {
  21. if (state is not AxisSetting<int> settings)
  22. return;
  23. this.DataSource = settings;
  24. this.Title = settings.Title;
  25. }
  26. }