public GlobalizationUtilities() { SupportedCultures = new List<SupportedCulture>(); SupportedCultures.Add(new SupportedCulture("de-DE", OnSelectedCultureChanged)); SupportedCultures.Add(new SupportedCulture("en-GB", OnSelectedCultureChanged)); SupportedCultures.Add(new SupportedCulture("en-US", OnSelectedCultureChanged)); SupportedCultures.Add(new SupportedCulture("fr-FR", OnSelectedCultureChanged)); SupportedCultures.Add(new SupportedCulture("fa-IR", OnSelectedCultureChanged)); SelectedCulture = SupportedCultures.FirstOrDefault(); }
public GlobalizationUtilities() { SupportedCultures = new List <SupportedCulture>(); SupportedCultures.Add(new SupportedCulture("de-DE", OnSelectedCultureChanged)); SupportedCultures.Add(new SupportedCulture("en-GB", OnSelectedCultureChanged)); SupportedCultures.Add(new SupportedCulture("en-US", OnSelectedCultureChanged)); SupportedCultures.Add(new SupportedCulture("fr-FR", OnSelectedCultureChanged)); SupportedCultures.Add(new SupportedCulture("fa-IR", OnSelectedCultureChanged)); SelectedCulture = SupportedCultures.FirstOrDefault(); }
private void SelectCulture(SupportedCulture culture) { if (SelectedCulture != null) { SelectedCulture.IsSelected = false; } SelectedCulture = culture; Thread.CurrentThread.CurrentCulture = culture.CultureInfo; Thread.CurrentThread.CurrentUICulture = culture.CultureInfo; if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(null)); if (SelectedCultureChanged != null) SelectedCultureChanged(this, EventArgs.Empty); }
private void SelectCulture(SupportedCulture culture) { if (SelectedCulture != null) { SelectedCulture.IsSelected = false; } SelectedCulture = culture; Thread.CurrentThread.CurrentCulture = culture.CultureInfo; Thread.CurrentThread.CurrentUICulture = culture.CultureInfo; if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(null)); } if (SelectedCultureChanged != null) { SelectedCultureChanged(this, EventArgs.Empty); } }
// Die Kultur hat sich geändert void OnSelectedCultureChanged(object sender, EventArgs e) { CurrentCulture = GlobalizationUtilities.TheInstance.SelectedCulture; }
// Konstruktor. Richtet Kultur und Änderungsbenachrichtigung ein public ViewModelBase() { _currentCulture = GlobalizationUtilities.TheInstance.SelectedCulture; GlobalizationUtilities.TheInstance.SelectedCultureChanged += OnSelectedCultureChanged; }