AffdexMe.MainWindow.CenterWindowOnScreen C# (CSharp) Метод

CenterWindowOnScreen() приватный Метод

Center the main window on the screen
private CenterWindowOnScreen ( ) : void
Результат void
        private void CenterWindowOnScreen()
        {
            double screenWidth = System.Windows.SystemParameters.PrimaryScreenWidth;
            double screenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;
            double windowWidth = this.Width;
            double windowHeight = this.Height;
            this.Left = (screenWidth / 2) - (windowWidth / 2);
            this.Top = (screenHeight / 2) - (windowHeight / 2);
        }