Exemplo n.º 1
0
        /// <summary>
        /// 切换语言
        /// </summary>
        public void SwitchLanguage(LanguageType langType = LanguageType.Cn, bool isLoadPageLanguage = false)
        {
            lock (_flyWeightLanguages)
            {
                _flyWeightLanguages.Clear();
            }
            switch (langType)
            {
            case LanguageType.En:
                PageLanguageHelper.LoadPageLanguage(new Uri("Pack://application:,,,/XLY.SF.Framework.Language;Component/Language/Language_En.xml", UriKind.RelativeOrAbsolute));
                _xmlDoc.LoadXml(Resource1.Language_En); break;

            case LanguageType.Cn:
                PageLanguageHelper.LoadPageLanguage(new Uri("Pack://application:,,,/XLY.SF.Framework.Language;Component/Language/Language_Cn.xml", UriKind.RelativeOrAbsolute));
                _xmlDoc.LoadXml(Resource1.Language_Cn); break;

            default:
                PageLanguageHelper.LoadPageLanguage(new Uri("Pack://application:,,,/XLY.SF.Framework.Language;Component/Language/Language_Cn.xml", UriKind.RelativeOrAbsolute));
                _xmlDoc.LoadXml(Resource1.Language_Cn); break;
            }
        }