From 0b075d3ad11714df59b8d87f1b689e33aeae459c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=82=E6=84=8F=20=E5=BD=AD?= <2417589739@qq.com> Date: Wed, 24 Aug 2022 13:27:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DosingSystem/Model/DeviceInquire.cs | 2 +- DosingSystem/ViewModel/DeviceListViewModel.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DosingSystem/Model/DeviceInquire.cs b/DosingSystem/Model/DeviceInquire.cs index 053a1230..d23ea993 100644 --- a/DosingSystem/Model/DeviceInquire.cs +++ b/DosingSystem/Model/DeviceInquire.cs @@ -57,7 +57,7 @@ namespace BPASmartClient.DosingSystem.Model int deviceIndex = Array.FindIndex(devices.ToArray(), p => p.IpAddress == DeviceLists.ElementAt(i).Key); if (deviceIndex >= 0 && deviceIndex < devices.Count) { - devices.ElementAt(i).DeviceName = DeviceLists.ElementAt(i).Value.DeviceName; + devices.ElementAt(deviceIndex).DeviceName = DeviceLists.ElementAt(i).Value.DeviceName; } } Thread.Sleep(200); diff --git a/DosingSystem/ViewModel/DeviceListViewModel.cs b/DosingSystem/ViewModel/DeviceListViewModel.cs index 6986c71c..bcefd24d 100644 --- a/DosingSystem/ViewModel/DeviceListViewModel.cs +++ b/DosingSystem/ViewModel/DeviceListViewModel.cs @@ -33,7 +33,7 @@ namespace BPASmartClient.DosingSystem.ViewModel public RelayCommand ChangeNameCommand { get; set; } //public static ObservableCollection devices { get; set; } = new ObservableCollection(); - public static ObservableCollection devices { get; set; } + public ObservableCollection devices { get; set; } } public class Devices : ObservableObject