public UpdateLanguage ( string displayName ) : bool | ||
displayName | string | |
Результат | bool |
private void LanguageComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { var comboBox = sender as ComboBox; if (comboBox.SelectedItem == null) { return; } languageManager.UpdateLanguage(comboBox.SelectedItem as string); }
private void LanguageComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { var comboBox = sender as ComboBox; languageManager.UpdateLanguage(comboBox.SelectedItem as string); // reload if (this.Frame != null) { Type type = this.Frame.CurrentSourcePageType; try { this.Frame.Navigate(type); } finally { this.Frame.BackStack.Remove(this.Frame.BackStack[this.Frame.BackStack.Count - 1]); } } }
private void LanguageListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { var listBox = sender as ListBox; if (!languageManager.UpdateLanguage(listBox.SelectedItem as string)) { // just exit if the language has not changed return; } // reload if (this.Frame != null) { Type type = this.Frame.CurrentSourcePageType; try { this.Frame.Navigate(type); this.Frame.BackStack.Remove(this.Frame.BackStack[this.Frame.BackStack.Count - 1]); } catch { } } }
private void SetPreferences() { var selectedLanguage = LanguagesListView.SelectedItem as string; languageManager.UpdateLanguage(selectedLanguage); }
private void SetPreferences() { if (null == LanguagesListView.SelectedItem) { NavigationUtils.NavigateToScreen(typeof(MainPage)); } else { LangApplyStack.Visibility = Visibility.Collapsed; string selectedLanguage = LanguagesListView.SelectedItem as string; //Check existing lang Tuple var currentLangTuple = languageManager.GetLanguageTuple(languageManager.GetLanguageTagFromDisplayName(selectedLanguage)); SpeechSupport.Text = currentLangTuple.Item2 ? languageManager["SpeechSupportText"] : languageManager["SpeechNotSupportText"]; if (LanguageManager.GetCurrentLanguageDisplayName().Equals(selectedLanguage)) { //Do Nothing return; } //Check if selected language is part of ffu var newLang = languageManager.CheckUpdateLanguage(selectedLanguage); if (LanguageManager.GetDisplayNameFromLanguageTag(newLang.Item4).Equals(selectedLanguage)) { //Update var langReturned = languageManager.UpdateLanguage(selectedLanguage); //ffu list, Show user to restart to use the System Languages if (newLang.Item1) { Common.LangApplyRebootRequired = true; LangApplyStack.Visibility = Visibility.Visible; } //else //skip providing option to restart app } else { if (newLang.Item2) { //Stop Automatic counter to switch to next screen timer.Stop(); countdown.Stop(); ChooseDefaultLanguage.Visibility = Visibility.Collapsed; CancelButton.Visibility = Visibility.Collapsed; //If different, show the popup for confirmation PopupText2.Text = LanguageManager.GetDisplayNameFromLanguageTag(newLang.Item4); PopupYes.Content = LanguageManager.GetDisplayNameFromLanguageTag(newLang.Item4); PopupText1.Text = languageManager["LanguagePopupText1"]; PopupText3.Text = languageManager["LanguagePopupText3"]; PopupNo.Content = LanguagesListView.SelectedItem as string; double hOffset = (Window.Current.Bounds.Width) / 4; double vOffset = (Window.Current.Bounds.Height) / 2; StandardPopup.VerticalOffset = vOffset; StandardPopup.HorizontalOffset = hOffset; if (!StandardPopup.IsOpen) { StandardPopup.IsOpen = true; } } else { //Just update silently in the background and dont ask for restart app var langReturned = languageManager.UpdateLanguage(selectedLanguage); } } } }
private bool SetPreferences() { var selectedLanguage = LanguagesListBox.SelectedItem as string; return(languageManager.UpdateLanguage(selectedLanguage)); }