예제 #1
0
 private void GoBack(object sender, RoutedEventArgs e)
 {
     if (Application.Current.Windows.OfType<MainWindow>().Any(w => w.Name.Equals("PreferencesPane")))
     {
         Application.Current.Windows.OfType<MainWindow>().Single().Focus();
     }
     else
     {
         var preferencePanel = new MainWindow();
         preferencePanel.Show();
     }
     Close();
 }
예제 #2
0
 private void showPreferences()
 {
     if (Application.Current.Windows.OfType<MainWindow>().Any(w => w.Name.Equals("PreferencesPane")))
         {
                 Application.Current.Windows.OfType<MainWindow>().Single().Focus();
         }
         else
         {
             var preferencePanel = new MainWindow();
             preferencePanel.Show();
         }
     if (Application.Current.Windows.OfType<FileChooser>().Any(w => w.Name.Equals("FileChooserWindow")))
     {
         Application.Current.Windows.OfType<FileChooser>().Single().Close();
     }
 }