终端一体化运控平台
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

49 linhas
1.6 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.DosingHKProject.View;
  13. using BPASmartClient.DosingHKProject.Model;
  14. namespace BPASmartClient.DosingHKProject.ViewModel
  15. {
  16. public class DeviceListViewModel : ObservableObject
  17. {
  18. public DeviceListViewModel()
  19. {
  20. ChangeNameCommand = new RelayCommand<object>((o) =>
  21. {
  22. if (o != null && o is string str)
  23. {
  24. ChangeDeviceNameView cdn = new ChangeDeviceNameView();
  25. ActionManage.GetInstance.Send("ChangeDeviceNameViewOpen", str);
  26. cdn.ShowDialog();
  27. }
  28. });
  29. devices = DeviceInquire.GetInstance.devices;
  30. }
  31. public RelayCommand<object> ChangeNameCommand { get; set; }
  32. //public static ObservableCollection<Devices> devices { get; set; } = new ObservableCollection<Devices>();
  33. public ObservableCollection<Devices> devices { get; set; }
  34. }
  35. public class Devices : ObservableObject
  36. {
  37. public string IpAddress { get { return _mIpAddress; } set { _mIpAddress = value; OnPropertyChanged(); } }
  38. private string _mIpAddress;
  39. public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; OnPropertyChanged(); } }
  40. private string _mDeviceName;
  41. }
  42. }