From e4320a34e934196110299f64e3313509833eb17a Mon Sep 17 00:00:00 2001 From: "SINVO\\yangshunli" Date: Wed, 15 Jan 2025 10:58:23 +0800 Subject: [PATCH] =?UTF-8?q?105067=20=E8=B0=83=E6=95=B4=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sinvo.EplanHpD.Plugin.WPFUI/View/ScannerInfo.xaml.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Sinvo.EplanHpD.Plugin.WPFUI/View/ScannerInfo.xaml.cs b/Sinvo.EplanHpD.Plugin.WPFUI/View/ScannerInfo.xaml.cs index 0fce9ae..219f64b 100644 --- a/Sinvo.EplanHpD.Plugin.WPFUI/View/ScannerInfo.xaml.cs +++ b/Sinvo.EplanHpD.Plugin.WPFUI/View/ScannerInfo.xaml.cs @@ -27,6 +27,18 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI.View public ScannerInfo(ScannerViewModel scannerViewModel) { InitializeComponent(); + Rect workArea = SystemParameters.WorkArea; + this.Top = workArea.Bottom - this.Height; + + // 如果需要,也可以设置窗口水平居中 + this.Left = (workArea.Width - this.ActualWidth) / 6; + + // 确保窗口在屏幕范围内(如果屏幕很小,上面的设置可能会导致窗口部分在屏幕外) + // 这通常不是必需的,但可以作为额外的安全检查 + if (this.Top < 0) + { + this.Top = 0; + } _scannerViewModel = scannerViewModel; this.DataContext = _scannerViewModel; this.Topmost = true;