Hi,
I am working on a Silverlight app at the moment. I have a few datagrids/textblocks where I use standard binding to show values, some of which are dates. e.g.
<sdk:DataGrid AutoGenerateColumns="False" IsReadOnly="True" ItemsSource="{Binding Path=MyCollection}">
<sdk:DataGrid.Columns>
<sdk:DataGridTextColumn Binding="{Binding Path=Name, Mode=OneWay}" Header="Agent"/>
<sdk:DataGridTextColumn Binding="{Binding Path=UpdateTime, Mode=OneWay}" Header="Update Time"/>
</sdk:DataGrid.Columns>
</sdk:DataGrid>
<TextBlock Text="{Binding Path=LastUpdatedTime}"/>
This binds fine but the dates are always shown as US style (m/d/y) whereas I want to show them UK style (d/m/y). I have tried setting the culture using both the HTML tags on the page hosting the application
<param name="uiculture" value="en-GB" />
<param name="culture" value="en-GB" />
and on Application_Start
of my Silverlight application
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-GB");
but neither of these make any difference. I have a custom class that implements IValueConverter
interface, I added a breakpoint on the Convert method and the CultureInfo parameter that is passed in is en-US, how do I change the culture?