使用本地区域设置来绑定的字符串格式 [英] Using local Regional settings for binding's stringformat
问题描述
嗨
我希望WPF使用我的Windows区域设置,而不是我在代码中设置的区域性.
I want WPF to use my Windows Regional Settings, not a culture I set in code.
我正在使用以下代码来获取WPF来关心我的文化设置:
I'm using the following code to get WPF to care about my culture settings:
FrameworkElement.LanguageProperty.OverrideMetadata( typeof(FrameworkElement),
new FrameworkPropertyMetadata(
System.Windows.Markup.XmlLanguage.GetLanguage(
System.Globalization.CultureInfo.CurrentUICulture.IetfLanguageTag)));
推荐答案
Pieter Muller,
Hi Pieter Muller,
您可以使用 CurrentCulture 和 CurrentUICulture CultureInfo 的属性.它们是静态属性,并赋予系统本地文化.
You can use the CurrentCulture and CurrentUICulture properties of CultureInfo . They are static properties and gives the local culture on the system.
http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.currentculture.aspx
http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.currentculture.aspx
谢谢,
穆罕默德
shujaatsiddiqi.blogspot.com
Thanks,
Muhammad
shujaatsiddiqi.blogspot.com
这篇关于使用本地区域设置来绑定的字符串格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!