终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

46 lines
1.4 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Microsoft.Toolkit.Mvvm.ComponentModel;
  7. using System.Collections.Concurrent;
  8. using System.Collections.ObjectModel;
  9. using System.Windows;
  10. using BPASmartClient.Helper;
  11. using Microsoft.Toolkit.Mvvm.Input;
  12. using BPASmartClient.DosingSystem.View;
  13. namespace BPASmartClient.DosingSystem.ViewModel
  14. {
  15. public class DeviceListViewModel : ObservableObject
  16. {
  17. public DeviceListViewModel()
  18. {
  19. ChangeNameCommand = new RelayCommand<object>((o) =>
  20. {
  21. if (o != null && o is string str)
  22. {
  23. ChangeDeviceNameView cdn = new ChangeDeviceNameView();
  24. ActionManage.GetInstance.Send("ChangeDeviceNameViewOpen", str);
  25. cdn.ShowDialog();
  26. }
  27. });
  28. }
  29. public RelayCommand<object> ChangeNameCommand { get; set; }
  30. public static ObservableCollection<Devices> devices { get; set; } = new ObservableCollection<Devices>();
  31. }
  32. public class Devices : ObservableObject
  33. {
  34. public string IpAddress { get { return _mIpAddress; } set { _mIpAddress = value; OnPropertyChanged(); } }
  35. private string _mIpAddress;
  36. public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; OnPropertyChanged(); } }
  37. private string _mDeviceName;
  38. }
  39. }