title: Center a popup/UserControl
body: <p>I want to center a PopUp exactly in the center of the screen.
  I have used a Usercontrol to display within the popup.
  However the way i am calculating HorizontalOffset and vertical offset is wrong.</p>
  
  <pre><code>        Popup popUp = new Popup();
          ProgressScreen progressScreen = new ProgressScreen();
          popUp.Child = progressScreen;
          //popUp.HorizontalOffset = (this.ActualWidth/2) + (progressScreen.ActualWidth / 2);
          popUp.VerticalOffset = (this.ActualHeight / 2) + (progressScreen.ActualHeight / 2);
          popUp.HorizontalOffset = (this.ActualWidth - progressScreen.ActualWidth) / 2;
          popUp.Height = this.ActualHeight;
          popUp.Width = this.ActualWidth;
          popUp.IsOpen = true;
  </code></pre>