爲什麼這個工作...Silverlight的DataGridTemplateColumn與DataGridTextColumn
<data:DataGridTemplateColumn Header="YTD v. Exchange" x:Name="YTDvExchange" Visibility="Collapsed" CanUserSort="True" SortMemberPath="ytdExchangeReturn.value">
<data:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock TextAlignment="Right" VerticalAlignment="Center"
Text="{Binding ytdExchangeReturn.value, Converter={StaticResource fcFixedDecimalConverter}}"
Foreground="{Binding ytdExchangeReturn.value, Converter={StaticResource fcForegroundValueConverter}}"/>
</DataTemplate>
</data:DataGridTemplateColumn.CellTemplate>
</data:DataGridTemplateColumn>
但這並不...
<data:DataGridTextColumn Header="YTD v. Exchange"
Binding="{Binding ytdExchangeReturn.value, Converter={StaticResource fcFixedDecimalConverter}}"
Foreground="{Binding ytdExchangeReturn.value, Converter={StaticResource fcForegroundValueConverter}}"/>
我得到 'System.Windows.Markup.XamlParseException:AG_E_PARSER_BAD_PROPERTY_VALUE' 爲第二個。該問題適用於前景轉換器,綁定是好的。