Reorganized MainWindow.xaml.cs.