private void SettingsCommand_Execute(object o, ExecutedRoutedEventArgs args) { var settingsView = new SettingsView { Owner = this }; if (settingsView.ShowDialog() == true) { Settings.Default.Lang = settingsView.ProgramLanguage; Settings.Default.RememberSizeAndPosition = settingsView.RememberStateAndPosition; Settings.Default.RememberRightToolBar = settingsView.RememberRightToolBar; Settings.Default.RememberBaseAndAngle = settingsView.RememberNumberAndAngle; if (!settingsView.RememberNumberAndAngle) { Settings.Default.AngleMeasurement = settingsView.Angle; Settings.Default.NumberBase = settingsView.Base; mathPresenter.AngleMeasurement = settingsView.Angle; mathPresenter.Base = settingsView.Base; } Settings.Default.MaxCountOfExpressions = settingsView.MaxCountOfExps; Settings.Default.DefaultChartColor = settingsView.ChartColor; Settings.Default.SaveUserFunction = settingsView.SaveUserFunctions; Settings.Default.SaveDump = settingsView.SaveDump; Settings.Default.Save(); } else { Settings.Default.Reload(); } }
private void SettingsCommand_Execute(object o, ExecutedRoutedEventArgs args) { var settingsView = new SettingsView() { Owner = this }; if (settingsView.ShowDialog() == true) { Settings.Default.Lang = settingsView.ProgramLanguage; Settings.Default.RememberSizeAndPosition = settingsView.RememberStateAndPosition; Settings.Default.RememberRightToolBar = settingsView.RememberRightToolBar; Settings.Default.RememberBaseAndAngle = settingsView.RememberNumberAndAngle; if (!settingsView.RememberNumberAndAngle) { Settings.Default.AngleMeasurement = settingsView.Angle; Settings.Default.NumberBase = settingsView.Base; mathPresenter.AngleMeasurement = settingsView.Angle; mathPresenter.Base = settingsView.Base; } Settings.Default.MaxCountOfExpressions = settingsView.MaxCountOfExps; Settings.Default.SaveUserFunction = settingsView.SaveUserFunctions; Settings.Default.CheckUpdates = settingsView.CheckUpdates; Settings.Default.Save(); } else { Settings.Default.Reload(); } }