WPF全屏应用程序-多台监视器

| 我的WPF应用程序中使用了多个监视器。该应用程序以全屏模式运行,并且我希望能够在用户按下按钮时切换到哪个监视器。
case Key.M:
                    var allScreens = System.Windows.Forms.Screen.AllScreens.ToList();
                    if (this.CurrentScreen < allScreens.Count - 1)
                    {
                        this.CurrentScreen++;
                    }
                    else { this.CurrentScreen = 0; }

                    this.WindowStartupLocation = System.Windows.WindowStartupLocation.Manual;
                    this.Top = allScreens[this.CurrentScreen].Bounds.Top;
                    this.Left = allScreens[this.CurrentScreen].Bounds.Left;
                    break;
我正在尝试这样做,但是this.Left始终具有(-7)的值。我假设它不让我设置它是因为我全屏显示,但我不确定100%。我如何才能全屏切换到另一台显示器?     
已邀请:
        作为一种技巧,您可以更改窗口状态,将其发送到其他监视器,然后将窗口状态更改回最大化:
this.WindowState = System.Windows.WindowState.Normal;
this.Left = screen.WorkingArea.Left;
this.Top = screen.WorkingArea.Top;
this.WindowState = System.Windows.WindowState.Maximized;
它的工作没有任何不良影响。刚刚测试过。     

要回复问题请先登录注册