private void CenterInContainer() { int x = (WindowHolder.Width >> 1) - (WindowPanel.Width >> 1); int y = (WindowHolder.Height >> 1) - (WindowPanel.Height >> 1); WindowPanel.Location = new Point(x, y); }