Move calibration code into Calibrate.xaml
Calculate and close when calibration is finished