DatePicker and CurrentCulture

Mar 17, 2009 at 3:38 AM
When I change the CurrentThread.CurrentCulture, the calendar drop down of the DatePicker control is not displayed in that culture.

Is there some property or method I can call?
Mar 17, 2009 at 7:48 AM
WPF controls don't update automatically on a change to CurrentCulture/CurrentUICulture. Simplest solution is to set the CurrentCulture before you open your window.
Mar 17, 2009 at 7:53 AM
I'm aware they don't update automatically, but is there some method I can call to cause the drop down to refresh its culture?

In our product, we change the calendar culture at runtime.
Coordinator
Mar 18, 2009 at 8:52 PM
Currently Calendar picks up the culture whenever the DisplayMode changes so as a work around changing the DisplayMode will force a recheck of the culture. As shown below.

        private void Cultures_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Thread.CurrentThread.CurrentCulture = new CultureInfo(((ComboBoxItem)Cultures.SelectedItem).Content as String);
            Microsoft.Windows.Controls.CalendarMode currentMode = cal.DisplayMode;
            cal.DisplayMode = currentMode == Microsoft.Windows.Controls.CalendarMode.Month ? Microsoft.Windows.Controls.CalendarMode.Year : Microsoft.Windows.Controls.CalendarMode.Month;
            cal.DisplayMode = currentMode;

        }