Search code examples
windowsxamlwindows-runtimewin-universal-appwinrt-xaml-toolkit

Customize Calendar Winrt Xaml Toolkit


I'm developing an Universal App for Win8.1, i've added the Winrt Xaml Toolkit dll but when i use Calendar control the strings of months appear only in English. Is there any way to change them? I'm going crazy :D

PS: I've downloaded the source code of dll but there is no track of these strings


Solution

  • If you look at the DateTimeHelper class, you can see the method GetCurrentDateFormat which uses the en-US format. This method is used in many places for the Calendar and CalendarItem controls from the toolkit.

    You can try to import the project from the site instead of using the NuGet package and then change this method to use your device locale. You can maybe change it to something like this:

    public static DateTimeFormatInfo GetCurrentDateFormat()
    {
        return CultureInfo.CurrentCulture.DateTimeFormat;
    }
    

    I haven't tested this code so this is just a hint where you should look for your solution.