In a small Wpf application, use a DatePicker bound to a DateTime property. When the user's region and language settings, and number and date format are German, the date is displayed in German, and the calendar shows German month names. Now I wanted to get it in US-English. In the c'tor of MainWindow I added before InitializeComponent() (same situation when doing that after InitializeComponent()):
string uiLanguage = ConfigurationManager.AppSettings["UILanguage"]; //"en-US"
Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(uiLanguage);
FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(uiLanguage)));
While that works with textboxes, it has no effect with the DatePicker. Then I was cheaky and created a new user "John English", logged in as "John English", set his display language to English and the date and number format to US-English. Now the DatePicker always displays the date in the US-English format and the calendar shows English month names, even when I set the language of my program to German. How can that be resolved? Can it be resolved at all?