[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 = []; Devices = [];
foreach(DeviceInfo device in devices) Dispatcher.UIThread.Invoke(() =>
{ {
Devices.Add(new DeviceModel foreach(DeviceInfo device in devices)
{ {
Bus = device.Bus, Devices.Add(new DeviceModel
Model = device.Model, {
Path = device.Path, Bus = device.Bus,
Serial = device.Serial, Model = device.Model,
Supported = device.Supported, Path = device.Path,
Vendor = device.Vendor Serial = device.Serial,
}); Supported = device.Supported,
} Vendor = device.Vendor
});
}
});
} }
catch(SocketException ex) catch(SocketException ex)
{ {