private void Btn_OK(object sender, RoutedEventArgs e)
        {
            VM_settings.SaveSettings();
            MainWindow win = (MainWindow)Application.Current.MainWindow;

            win.Show();
            this.Close();
        }
 /// <summary>
 /// The OK botton of the settings window
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ok_Click(object sender, RoutedEventArgs e)
 {
     // if all the fields are not empty
     if (ServerIP.Text != "" && ServerPort.Text != "" && CommandPort.Text != "")
     {
         // update thee view model properties
         vm.FlightServerIP    = ServerIP.Text;
         vm.FlightInfoPort    = Int32.Parse(ServerPort.Text);
         vm.FlightCommandPort = Int32.Parse(CommandPort.Text);
         vm.SaveSettings();
         vm.ReloadSettings();
     }
     Close(); // close the window
 }
예제 #3
0
 private void BtnSave_Click(object sender, RoutedEventArgs e)
 {
     _settingsWindowViewModel.SaveSettings();
 }
 private void OK_Btn_Click(object sender, RoutedEventArgs e)
 {
     vm.SaveSettings();
     this.Close();
 }
예제 #5
0
 public void SaveSettings()
 {
     _settingsWindowViewModel.SaveSettings();
 }