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;