将设备列表,变量表列表,变量列表从ObservableCollection更换为字典类型的ObservableDictionary

This commit is contained in:
2025-09-16 13:05:37 +08:00
parent ffa24f861e
commit 3102938f92
11 changed files with 58 additions and 60 deletions

View File

@@ -159,8 +159,7 @@ public partial class DeviceDetailViewModel : ViewModelBase, INavigatable
public async Task OnNavigatedToAsync(MenuItemViewModel menu)
{
var device = _dataStorageService.Devices.FirstOrDefault(d => d.Id == menu.TargetId);
if (device != null)
if (_dataStorageService.Devices.TryGetValue(menu.TargetId,out var device))
{
CurrentDevice = device;
}