c#代码设置WPF窗体显示到第二个显示屏

想在WPF窗体界面放二个按钮,显示屏幕1 显示屏幕2 当我点击按钮 显示屏幕1 窗体全屏显示在 主屏幕 ; 相反,当我点击 显示屏幕2 就显示在 第二个屏幕去...!

https://social.msdn.microsoft.com/Forums/en-US/32d60663-8264-4153-9fb0-7053468191f2/how-to-show-a-wpf-window-in-secondary-monitor?forum=wpf

参考:

 using System.Linq;
using System.Windows;

namespace ExtendedControls
{
    static public class WindowExt
    {

        // NB : Best to call this function from the windows Loaded event or after showing the window
        // (otherwise window is just positioned to fill the secondary monitor rather than being maximised).
        public static void MaximizeToSecondaryMonitor(this Window window)
        {
            var secondaryScreen = System.Windows.Forms.Screen.AllScreens.Where(s => !s.Primary).FirstOrDefault();

            if (secondaryScreen != null)
            {
                if (!window.IsLoaded)
                    window.WindowStartupLocation = WindowStartupLocation.Manual;

                var workingArea = secondaryScreen.WorkingArea;
                window.Left = workingArea.Left;
                window.Top = workingArea.Top;
                window.Width = workingArea.Width;
                window.Height = workingArea.Height;
                // If window isn't loaded then maxmizing will result in the window displaying on the primary monitor
                if ( window.IsLoaded )
                    window.WindowState = WindowState.Maximized;
            }
        }
    }
}

http://stackoverflow.com/questions/9972044/how-to-set-wpf-window-position-in-secondary-display