[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,18 +146,21 @@ public partial class DeviceListViewModel : ViewModelBase
Devices = [];
foreach(DeviceInfo device in devices)
Dispatcher.UIThread.Invoke(() =>
{
Devices.Add(new DeviceModel
foreach(DeviceInfo device in devices)
{
Bus = device.Bus,
Model = device.Model,
Path = device.Path,
Serial = device.Serial,
Supported = device.Supported,
Vendor = device.Vendor
});
}
Devices.Add(new DeviceModel
{
Bus = device.Bus,
Model = device.Model,
Path = device.Path,
Serial = device.Serial,
Supported = device.Supported,
Vendor = device.Vendor
});
}
});
}
catch(SocketException ex)
{