diff --git a/DMS.WPF/ViewModels/DeviceDetailViewModel.cs b/DMS.WPF/ViewModels/DeviceDetailViewModel.cs
index 4d540f0..a72e675 100644
--- a/DMS.WPF/ViewModels/DeviceDetailViewModel.cs
+++ b/DMS.WPF/ViewModels/DeviceDetailViewModel.cs
@@ -12,6 +12,7 @@ using DMS.WPF.Interfaces;
using DMS.WPF.ViewModels.Dialogs;
using DMS.WPF.ViewModels.Items;
using iNKORE.UI.WPF.Modern.Common.IconKeys;
+using Microsoft.Extensions.DependencyInjection;
namespace DMS.WPF.ViewModels;
@@ -209,4 +210,22 @@ public partial class DeviceDetailViewModel : ViewModelBase
new NavigationParameter(nameof(VariableTableViewModel), SelectedVariableTable.Id,
NavigationType.VariableTable));
}
+
+ ///
+ /// 返回到设备列表页命令
+ ///
+ [RelayCommand]
+ private async Task NavigateToDevicesList()
+ {
+ try
+ {
+ // 导航到设备列表页面
+ var navigationService = App.Current.Services.GetRequiredService();
+ await navigationService.NavigateToAsync(this, new NavigationParameter(nameof(DevicesViewModel), 0, NavigationType.Device));
+ }
+ catch (Exception ex)
+ {
+ _notificationService.ShowError($"导航到设备列表失败: {ex.Message}", ex);
+ }
+ }
}
diff --git a/DMS.WPF/ViewModels/VariableTableViewModel.cs b/DMS.WPF/ViewModels/VariableTableViewModel.cs
index 20d99b4..d8f3798 100644
--- a/DMS.WPF/ViewModels/VariableTableViewModel.cs
+++ b/DMS.WPF/ViewModels/VariableTableViewModel.cs
@@ -744,6 +744,24 @@ partial class VariableTableViewModel : ViewModelBase, INavigatable
new NavigationParameter(nameof(VariableHistoryViewModel), SelectedVariable.Id, NavigationType.Variable));
}
+ ///
+ /// 返回到设备详情页命令
+ ///
+ [RelayCommand]
+ private async Task NavigateToDeviceDetail()
+ {
+ try
+ {
+ // 导航到设备详情页面
+ var navigationService = App.Current.Services.GetRequiredService();
+ await navigationService.NavigateToAsync(this, new NavigationParameter(nameof(DeviceDetailViewModel), CurrentVariableTable.DeviceId, NavigationType.Device));
+ }
+ catch (Exception ex)
+ {
+ _notificationService.ShowError($"导航到设备详情失败: {ex.Message}", ex);
+ }
+ }
+
///
/// 修改选定变量的历史记录设置。
///
diff --git a/DMS.WPF/Views/DeviceDetailView.xaml b/DMS.WPF/Views/DeviceDetailView.xaml
index 6a4f419..45f5e80 100644
--- a/DMS.WPF/Views/DeviceDetailView.xaml
+++ b/DMS.WPF/Views/DeviceDetailView.xaml
@@ -73,25 +73,49 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DMS.WPF/Views/MainView.xaml b/DMS.WPF/Views/MainView.xaml
index 862576b..77378f0 100644
--- a/DMS.WPF/Views/MainView.xaml
+++ b/DMS.WPF/Views/MainView.xaml
@@ -9,7 +9,6 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mo="clr-namespace:DMS.Core.Models;assembly=DMS.Core"
xmlns:taskbarNotification="http://www.hardcodet.net/taskbar"
- xmlns:tb="http://hardcodet.net/taskbar"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:vm="clr-namespace:DMS.WPF.ViewModels"
Title="设备管理系统"
@@ -57,7 +56,7 @@
-
-
-
-
+
@@ -51,10 +44,17 @@
+ Style="{StaticResource ButtonDefault}"
+ ToolTip="返回变量表"
+ Margin="0,0,10,0">
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -98,7 +118,8 @@
Label="Settings" />
-
+
+
-
+
-