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