StringFormat Localization issues in wpf

datetime, localization, wpf

Solution

// Ensure the current culture passed into bindings is the OS culture.
// By default, WPF uses en-US as the culture, regardless of the system settings.
FrameworkElement.LanguageProperty.OverrideMetadata(
      typeof(FrameworkElement),
      new FrameworkPropertyMetadata(
          XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));

From Creating an Internationalized Wizard in WPF

Problem

In WPF 3.5SP1 i use the last feature StringFormat in DataBindings: ``` <TextBlock Text="{Binding Path=Model.SelectedNoteBook.OriginalDate, StringFormat='f'}" FontSize="20" TextTrimming="CharacterEllipsis" /> ``` The problem I face is that the date is always formatted in English...although my system is in French ? How can i force the date to follow system date?

Original source

Related problems