终端一体化运控平台
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

DeviceListViewModel.cs 1.6 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. }