From f64a0f7b3129fc6e63e4889bf70877544ab389f9 Mon Sep 17 00:00:00 2001 From: "zhengxuan.zhang" Date: Fri, 24 Apr 2026 11:18:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96CNC=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E4=B8=BA2=E5=88=97=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- XplorePlane/ViewModels/Main/MainViewModel.cs | 2 +- XplorePlane/Views/Cnc/CncPageView.xaml | 355 ++++++++----------- XplorePlane/Views/Cnc/CncPageView.xaml.cs | 15 +- 3 files changed, 161 insertions(+), 211 deletions(-) diff --git a/XplorePlane/ViewModels/Main/MainViewModel.cs b/XplorePlane/ViewModels/Main/MainViewModel.cs index 1809723..fdd75c9 100644 --- a/XplorePlane/ViewModels/Main/MainViewModel.cs +++ b/XplorePlane/ViewModels/Main/MainViewModel.cs @@ -21,7 +21,7 @@ namespace XplorePlane.ViewModels { public class MainViewModel : BindableBase { - private const double CncEditorHostWidth = 710d; + private const double CncEditorHostWidth = 502d; private readonly ILoggerService _logger; private readonly IContainerProvider _containerProvider; private readonly IEventAggregator _eventAggregator; diff --git a/XplorePlane/Views/Cnc/CncPageView.xaml b/XplorePlane/Views/Cnc/CncPageView.xaml index 147fbf9..b320d06 100644 --- a/XplorePlane/Views/Cnc/CncPageView.xaml +++ b/XplorePlane/Views/Cnc/CncPageView.xaml @@ -9,7 +9,7 @@ xmlns:views="clr-namespace:XplorePlane.Views" xmlns:vm="clr-namespace:XplorePlane.ViewModels.Cnc" d:DesignHeight="760" - d:DesignWidth="702" + d:DesignWidth="502" prism:ViewModelLocator.AutoWireViewModel="True" mc:Ignorable="d"> @@ -23,9 +23,6 @@ - - - Microsoft YaHei UI @@ -101,8 +98,8 @@ - - - + @@ -248,18 +243,15 @@ Stretch="Uniform" /> - - - + FontFamily="{StaticResource UiFont}" + FontSize="11" + FontWeight="SemiBold" + Text="{Binding Name}" + TextTrimming="CharacterEllipsis" /> - - - - + + + + + - - + + - - - - - - - - - - - + - - + + - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - - - - - - + + + + + + - - - + + - - - + CornerRadius="6"> diff --git a/XplorePlane/Views/Cnc/CncPageView.xaml.cs b/XplorePlane/Views/Cnc/CncPageView.xaml.cs index 530b86f..9c56a20 100644 --- a/XplorePlane/Views/Cnc/CncPageView.xaml.cs +++ b/XplorePlane/Views/Cnc/CncPageView.xaml.cs @@ -69,7 +69,6 @@ namespace XplorePlane.Views.Cnc logger); InspectionModulePipelineEditor.DataContext = _inspectionModulePipelineViewModel; - InspectionModulePipelineEmptyState.DataContext = _inspectionModulePipelineViewModel; } catch (Exception) { @@ -216,6 +215,10 @@ namespace XplorePlane.Views.Cnc } bool isReadOnlyNode = viewModel.SelectedNode?.IsReadOnlyNodeProperties == true; + bool showNodeProperties = viewModel.SelectedNode != null && !viewModel.SelectedNode.IsInspectionModule; + + NodePropertyEditor.Visibility = showNodeProperties ? Visibility.Visible : Visibility.Collapsed; + NodePropertyEmptyState.Visibility = viewModel.SelectedNode == null ? Visibility.Visible : Visibility.Collapsed; foreach (var textBox in FindVisualDescendants(propertyEditorRoot)) { @@ -322,15 +325,7 @@ namespace XplorePlane.Views.Cnc private DependencyObject FindPropertyEditorRoot() { - foreach (var scrollViewer in FindVisualDescendants(this)) - { - if (Grid.GetColumn(scrollViewer) == 2) - { - return scrollViewer; - } - } - - return null; + return NodePropertyEditor; } private static Border FindNodeCard(DependencyObject root)