[GUI] Ensure devices list is filled in UI thread.

This commit is contained in:
2025-11-19 13:10:13 +00:00
parent cd699f46de
commit 7bee2d7473

View File

@@ -146,6 +146,8 @@ public partial class DeviceListViewModel : ViewModelBase
Devices = []; Devices = [];
Dispatcher.UIThread.Invoke(() =>
{
foreach(DeviceInfo device in devices) foreach(DeviceInfo device in devices)
{ {
Devices.Add(new DeviceModel Devices.Add(new DeviceModel
@@ -158,6 +160,7 @@ public partial class DeviceListViewModel : ViewModelBase
Vendor = device.Vendor Vendor = device.Vendor
}); });
} }
});
} }
catch(SocketException ex) catch(SocketException ex)
{ {