0
如何正確設置文化以便標籤的內容是「seg」(星期一用巴西葡萄牙語)?在標籤中設置日期格式的文化
爲TextBlock設置ConverterCulture文本綁定將其更改爲pt-BR,但爲標籤的內容綁定設置ConverterCulture不會。下面的XAML。
<Window x:Class="CurrentCulture.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Grid.Resources>
<sys:DateTime x:Key="Td:Mon">2007-1-1</sys:DateTime>
</Grid.Resources>
<StackPanel>
<Label Content="{Binding Source={StaticResource Td:Mon}, ConverterCulture=pt-BR}" ContentStringFormat="{}{0:ddd}" />
<TextBlock Text="{Binding Source={StaticResource Td:Mon}, ConverterCulture=pt-BR,StringFormat={}{0:ddd}}" />
</StackPanel>
</Grid>
</Window>