WarningListViewModel.cs 716 B

1234567891011121314151617181920212223242526272829303132
  1. namespace DashBoard.ViewModel.Dialog;
  2. internal partial class WarningListViewModel : ObservableObject, IDialogAware
  3. {
  4. public DialogCloseListener RequestClose { get; set; }
  5. [ObservableProperty]
  6. private string? _Title;
  7. [ObservableProperty]
  8. private ObservableCollection<Alarm_VM>? _Alarms;
  9. public bool CanCloseDialog()
  10. {
  11. return true;
  12. }
  13. public void OnDialogClosed()
  14. {
  15. }
  16. public void OnDialogOpened(IDialogParameters parameters)
  17. {
  18. this.Title = "报警列表";
  19. if (!parameters.TryGetValue("alarm", out ObservableCollection<Alarm_VM>? alarms) || alarms is null)
  20. {
  21. return;
  22. }
  23. this.Alarms = alarms;
  24. }
  25. }