private void ChangeLang_Click(object sender, RoutedEventArgs e) { var langSelectView = new LanguageSelectView(); langSelectView.ShowDialog(); var langCode = langSelectView.LanguageCode; if (string.IsNullOrEmpty(langCode)) return; SaveSettings.Default.Language = langCode; System.Windows.Forms.Application.Restart(); System.Windows.Application.Current.Shutdown(); }
private void LanguageSelection() { var lang = Properties.Settings.Default.Application_Language; if (lang.Equals(string.Empty)) { var langSelectView = new LanguageSelectView(); langSelectView.ShowDialog(); var langCode = langSelectView.LanguageCode; Properties.Settings.Default.Application_Language = langCode; Properties.Settings.Default.Save(); } }
private void LanguageSelection() { var lang = Properties.Settings.Default.Application_Language; if (lang.Equals(string.Empty)) { var langSelectView = new LanguageSelectView(); langSelectView.ShowDialog(); var langCode = langSelectView.LanguageCode; Properties.Settings.Default.Application_Language = langCode; Properties.Settings.Default.Save(); } else if (lang != Properties.Settings.Default.Application_Language) { // We shouldn't evet actually get here, as this function is only called on // first time installs, where lang would be empty, and other calls force-restart the application. // But doesn't hurt to have a safety check here anyways. InitializeCache(); } }