AxisFloatViewModel.cs 641 B

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