Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Thai (th-TH) culture of DatePicker control in WPF is not working

$
0
0

HI,

I set thai culture at WPF app startup as folllowing :

string culture = "th-TH";
System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo(culture);
System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture);
FrameworkElement.LanguageProperty.OverrideMetadata(
                typeof(FrameworkElement),
                new FrameworkPropertyMetadata(
                    XmlLanguage.GetLanguage(culture)));

And my XAML as follows:

<DatePicker SelectedDate="{Binding StartDate, StringFormat=d}"  Height="25" HorizontalAlignment="Left" Margin="178,12,0,0" Name="datePicker1" VerticalAlignment="Top" Width="115" />

It shows monthname in datepicker's calendar as thai which is correct, but year should be current year + 500 something, which is not reflecting in XAML.


P :)


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>