Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
 // Die Kultur hat sich geändert
 void OnSelectedCultureChanged(object sender, EventArgs e)
 {
     CurrentCulture = GlobalizationUtilities.TheInstance.SelectedCulture;
 }
Exemplo n.º 6
0
 // Konstruktor. Richtet Kultur und Änderungsbenachrichtigung ein
 public ViewModelBase()
 {
     _currentCulture = GlobalizationUtilities.TheInstance.SelectedCulture;
     GlobalizationUtilities.TheInstance.SelectedCultureChanged += OnSelectedCultureChanged;
 }