From 59fce4f8fa6f3921d1c8cdf76fc4c2a8965103b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=BC=9F?= Date: Sat, 9 May 2026 13:27:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=9E=E6=97=B6=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E6=97=B6=E7=A6=81=E7=94=A8=E6=B5=8B=E9=87=8F?= =?UTF-8?q?=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - MainViewModel: 添加 IsMeasurementToolsEnabled 属性 - MainWindow: 为测量工具按钮绑定 IsEnabled --- XplorePlane/ViewModels/Main/MainViewModel.cs | 4 ++++ XplorePlane/Views/Main/MainWindow.xaml | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/XplorePlane/ViewModels/Main/MainViewModel.cs b/XplorePlane/ViewModels/Main/MainViewModel.cs index 945c18d..da32e71 100644 --- a/XplorePlane/ViewModels/Main/MainViewModel.cs +++ b/XplorePlane/ViewModels/Main/MainViewModel.cs @@ -142,9 +142,13 @@ namespace XplorePlane.ViewModels _mainViewportService.SetRealtimeDisplayEnabled(value); RaisePropertyChanged(); + RaisePropertyChanged(nameof(IsMeasurementToolsEnabled)); } } + /// 测量工具是否可用(实时模式关闭时启用) + public bool IsMeasurementToolsEnabled => !IsMainViewportRealtimeEnabled; + public bool IsUsingLiveDetectorSource => _mainViewportService.CurrentSourceMode == MainViewportSourceMode.LiveDetector; public string DataRootPath diff --git a/XplorePlane/Views/Main/MainWindow.xaml b/XplorePlane/Views/Main/MainWindow.xaml index 6cc5237..a93957b 100644 --- a/XplorePlane/Views/Main/MainWindow.xaml +++ b/XplorePlane/Views/Main/MainWindow.xaml @@ -213,6 +213,7 @@ telerik:ScreenTip.Description="测量两点之间的距离" telerik:ScreenTip.Title="点点距测量" Command="{Binding PointDistanceMeasureCommand}" + IsEnabled="{Binding IsMeasurementToolsEnabled}" Size="Medium" SmallImage="/Assets/Icons/ptop.png" Text="点点距测量" /> @@ -220,6 +221,7 @@ telerik:ScreenTip.Description="测量点到直线的距离" telerik:ScreenTip.Title="点线距测量" Command="{Binding PointLineDistanceMeasureCommand}" + IsEnabled="{Binding IsMeasurementToolsEnabled}" Size="Medium" SmallImage="/Assets/Icons/ptol.png" Text="点线距测量" /> @@ -231,6 +233,7 @@ telerik:ScreenTip.Description="测量两条线之间的角度" telerik:ScreenTip.Title="角度测量" Command="{Binding AngleMeasureCommand}" + IsEnabled="{Binding IsMeasurementToolsEnabled}" Size="Medium" SmallImage="/Assets/Icons/angle.png" Text="角度测量" /> @@ -238,6 +241,7 @@ telerik:ScreenTip.Description="测量通孔填锡率" telerik:ScreenTip.Title="通孔填锡率测量" Command="{Binding ThroughHoleFillRateMeasureCommand}" + IsEnabled="{Binding IsMeasurementToolsEnabled}" Size="Medium" SmallImage="/Assets/Icons/cylinder.png" Text="通孔填锡率" /> @@ -249,6 +253,7 @@ telerik:ScreenTip.Description="手动气泡测量(魔棒+画笔)" telerik:ScreenTip.Title="气泡测量" Command="{Binding BubbleMeasureCommand}" + IsEnabled="{Binding IsMeasurementToolsEnabled}" Size="Medium" SmallImage="/Assets/Icons/pores.png" Text="气泡测量" />