终端一体化运控平台
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DeviceListViewModel.cs 1.7 KiB

2 년 전
2 년 전
2 년 전
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using BPA.Helper;
  7. using System.Collections.Concurrent;
  8. using System.Collections.ObjectModel;
  9. using System.Windows;
  10. using BPASmartClient.DosingSystem.View;
  11. namespace BPASmartClient.DosingSystem.ViewModel
  12. {
  13. public class DeviceListViewModel : ViewModelBase
  14. {
  15. public DeviceListViewModel()
  16. {
  17. DetailsCommand = new BPARelayCommand<object>((o) =>
  18. {
  19. if (o != null && o is string str)
  20. {
  21. ChangeDeviceNameView cdn = new ChangeDeviceNameView();
  22. ActionManage.GetInstance.Send("ChangeDeviceNameViewOpen", str);
  23. cdn.ShowDialog();
  24. }
  25. });
  26. devices = DeviceInquire.GetInstance.devices;
  27. }
  28. //public BPARelayCommand<object> ChangeNameCommand { get; set; }
  29. //public static ObservableCollection<Devices> devices { get; set; } = new ObservableCollection<Devices>();
  30. public ObservableCollection<Devices> devices { get; set; }
  31. }
  32. public class Devices : NotifyBase
  33. {
  34. public string IpAddress { get { return _mIpAddress; } set { _mIpAddress = value; OnPropertyChanged(); } }
  35. private string _mIpAddress;
  36. /// <summary>
  37. /// 设备编号
  38. /// </summary>
  39. public int DeviceNum { get { return _mDeviceNum; } set { _mDeviceNum = value; OnPropertyChanged(); } }
  40. private int _mDeviceNum;
  41. public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; OnPropertyChanged(); } }
  42. private string _mDeviceName;
  43. }
  44. }