WPF 本地化(比如DatePicker)

在启动的时候设置:(比如App的OnStartup方法)

//设置为中文
CultureInfo culture = new System.Globalization.CultureInfo("zh-cn");
System.Threading.Thread.CurrentThread.CurrentCulture = culture;
System.Threading.Thread.CurrentThread.CurrentUICulture = culture;

参考资料

Localization in WPF DatePicker (SfDatePicker)
上述资料里提到可以自定义资源来设置本地化
C# CultureInfo 类之各国语言所对应的的区域性名称

posted @ 2021-05-07 17:23  Lulus  阅读(271)  评论(0编辑  收藏  举报