实现了设备详情页面,并添加了在设备界面点击对应的设备直接跳转到设备详情页面

This commit is contained in:
2025-07-16 18:39:00 +08:00
parent b17ee045ff
commit 76f16d50be
18 changed files with 374 additions and 63 deletions

View File

@@ -1,6 +1,7 @@
using System.Collections.ObjectModel;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using PMSWPF.Data;
using PMSWPF.Data.Repositories;
@@ -160,4 +161,13 @@ public partial class DevicesViewModel : ViewModelBase
NotificationHelper.ShowError($"编辑设备的过程中发生错误:{e.Message}", e);
}
}
[RelayCommand]
public void NavigateToDetail()
{
if (SelectedDevice == null) return;
var deviceDetailVm = App.Current.Services.GetRequiredService<DeviceDetailViewModel>();
deviceDetailVm.CurrentDevice = SelectedDevice;
MessageHelper.SendNavgatorMessage(deviceDetailVm);
}
}