From 66dd16c3c671295b535b64a3faa747956882e1f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E4=BC=9F?= Date: Wed, 29 Apr 2026 14:06:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E8=88=AA=E7=9B=B8=E6=9C=BA=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E8=AE=BE=E7=BD=AEUI=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/Setting/CameraSettingsWindow.xaml | 189 +++++++++++++----- .../Setting/CameraSettingsWindow.xaml.cs | 22 +- 2 files changed, 162 insertions(+), 49 deletions(-) diff --git a/XplorePlane/Views/Setting/CameraSettingsWindow.xaml b/XplorePlane/Views/Setting/CameraSettingsWindow.xaml index 413c33d..a0e9ddc 100644 --- a/XplorePlane/Views/Setting/CameraSettingsWindow.xaml +++ b/XplorePlane/Views/Setting/CameraSettingsWindow.xaml @@ -2,56 +2,149 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="相机参数设置" - Width="320" Height="420" + Width="340" Height="440" WindowStartupLocation="CenterOwner" - ResizeMode="NoResize" - ShowInTaskbar="False"> - + ResizeMode="NoResize" ShowInTaskbar="False" + Background="#F5F5F5" FontFamily="Microsoft YaHei UI"> + + + + + + + + + + + + + + + + + + + + + + + - - - + + - \ No newline at end of file + diff --git a/XplorePlane/Views/Setting/CameraSettingsWindow.xaml.cs b/XplorePlane/Views/Setting/CameraSettingsWindow.xaml.cs index e9f43f9..338c524 100644 --- a/XplorePlane/Views/Setting/CameraSettingsWindow.xaml.cs +++ b/XplorePlane/Views/Setting/CameraSettingsWindow.xaml.cs @@ -1,4 +1,5 @@ using System.Windows; +using System.Windows.Input; namespace XplorePlane.Views { @@ -9,5 +10,24 @@ namespace XplorePlane.Views InitializeComponent(); DataContext = viewModel; } + + private void ApplyAll_Click(object sender, RoutedEventArgs e) + { + var dc = DataContext; + if (dc == null) return; + var type = dc.GetType(); + ExecuteCommand(type, dc, "ApplyExposureCommand"); + ExecuteCommand(type, dc, "ApplyGainCommand"); + ExecuteCommand(type, dc, "ApplyWidthCommand"); + ExecuteCommand(type, dc, "ApplyHeightCommand"); + ExecuteCommand(type, dc, "ApplyPixelFormatCommand"); + } + + private static void ExecuteCommand(System.Type type, object dc, string cmdName) + { + var prop = type.GetProperty(cmdName); + if (prop?.GetValue(dc) is ICommand cmd && cmd.CanExecute(null)) + cmd.Execute(null); + } } -} \ No newline at end of file +}