多语言

public class CultureeeResolver : IValueResolver<ILocalizableDbEntity, ILocalizableModel, string>
    {
        public string Resolve(ILocalizableDbEntity source, ILocalizableModel destination, string destMember,
            ResolutionContext context)
        {
            var culture = Thread.CurrentThread.CurrentUICulture;

           
        }
    }

 

public class CultureResolver : IValueResolver<ILocalizableDbEntity, ILocalizableModel, string>    {        public string Resolve(ILocalizableDbEntity source, ILocalizableModel destination, string destMember,            ResolutionContext context)        {            var culture = Thread.CurrentThread.CurrentUICulture;
            SystemLang currentLang;            if (!EnumsNET.Enums.TryParse<SystemLang>(culture.Name, out currentLang))            {                currentLang = SystemLang.English;            }
            return currentLang == SystemLang.Chinese ? source.NameCN : source.NameEN;        }    }

上一篇:WPF Image Source设置文件路径后 在编辑状态下显示图片,运行时不显示


下一篇:26、(小实验)理解编译原理:一个四则运算的解释器