//此程序實現窗體居中顯示
Window1 myWindow1 = new Window1();
double screeHeight = SystemParameters.FullPrimaryScreenHeight;
double screeWidth = SystemParameters.FullPrimaryScreenWidth;
myWindow1.Top = (screeHeight - this.Height) / 2;
myWindow1.Left = (screeWidth - this.Height) / 2;
myWindow1.Show();
}