public void ChangeLocale(eLocales locale, Collection <ResourceDictionary> applicationResources)
        {
            AppLogger.Instance.Log(eLogType.Debug, string.Format("BEGIN:: {0}", System.Reflection.MethodInfo.GetCurrentMethod().Name));
            int resourcesIndex = -1;

            for (int i = 0; i < applicationResources.Count; i++)
            {
                if (applicationResources[i].Contains("ApplicationLocale"))
                {
                    resourcesIndex = i;
                    break;
                }
            }
            string fileName = string.Empty;

            if (locale == eLocales.English)
            {
                fileName = Paths.EnglishLocale;
            }
            else
            {
                fileName = Paths.GermanLocale;
            }
            LoadResourceFile(fileName, resourcesIndex, applicationResources);
            AppLogger.Instance.Log(eLogType.Debug, string.Format("END:: {0}", System.Reflection.MethodInfo.GetCurrentMethod().Name));
        }
Beispiel #2
0
        private void ChangeResourceDictionary(eLocales locale)
        {
            AppLogger.Instance.Log(eLogType.Debug, string.Format("BEGIN:: {0}", System.Reflection.MethodInfo.GetCurrentMethod().Name));
            RuagResourceManager.Instance.ChangeLocale(locale, this.Resources.MergedDictionaries);

            AppLogger.Instance.Log(eLogType.Debug, string.Format("END:: {0}", System.Reflection.MethodInfo.GetCurrentMethod().Name));
        }
 private void LocaleChanged(eLocales locale)
 {
     AppLogger.Instance.LogBegin(this.GetType().Name, System.Reflection.MethodInfo.GetCurrentMethod().Name);
     GalaSoft.MvvmLight.Messaging.Messenger.Default.Send <LocaleMessage>(new LocaleMessage()
     {
         SelectedLocale = locale
     });;
     AppLogger.Instance.LogEnd(this.GetType().Name, System.Reflection.MethodInfo.GetCurrentMethod().Name);
 }
 private void LocaleChangeMsgHandler(LocaleMessage obj)
 {
     AppLogger.Instance.LogBegin(this.GetType().Name, System.Reflection.MethodInfo.GetCurrentMethod().Name);
     CurrentLocale = obj.SelectedLocale;
     LocaleChagedEvent(this, new LocaleChangeEventArgs()
     {
         NewLocale = obj.SelectedLocale
     });
     AppLogger.Instance.LogEnd(this.GetType().Name, System.Reflection.MethodInfo.GetCurrentMethod().Name);
 }