private void btnSave_Click(object sender, RoutedEventArgs e)
 {
     if (ProgramSettings != null)
     {
         using (ConfigurationManager man = new ConfigurationManager())
         {
             if (man.SaveProgramSettings(ProgramSettings))
                 MessageBox.Show(this, "Настройки успешно изменены.", string.Empty, MessageBoxButton.OK, MessageBoxImage.Information);
         }
     }
     this.Close();
 }