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 }
private void BtnSave_Click(object sender, RoutedEventArgs e) { _settingsWindowViewModel.SaveSettings(); }
private void OK_Btn_Click(object sender, RoutedEventArgs e) { vm.SaveSettings(); this.Close(); }
public void SaveSettings() { _settingsWindowViewModel.SaveSettings(); }