我有转换器绑定.我想将"#,,.0M"格式字符串作为转换器参数传递.
此xaml无效:
<local:SalesPerformanceControl FirstSalesVolume="{Binding Path=TodaySalesVolume, Converter={StaticResource ResourceKey=decimalToFormatedStringConverter}, ConverterParameter=#,,.0M}"/>
Run Code Online (Sandbox Code Playgroud)
错误:
找不到类型''.
如何正确传递此字符串?
要在要传递的字符串上使用单引号:
<local:SalesPerformanceControl FirstSalesVolume="{Binding Path=TodaySalesVolume, Converter={StaticResource ResourceKey=decimalToFormatedStringConverter}, ConverterParameter='#,,.0M'}"/>
Run Code Online (Sandbox Code Playgroud)
或使用精心设计的语法绑定如下:
<local:SalesPerformanceControl>
<local:SalesPerformanceControl.FirstSalesVolume>
<Binding Path="TodaySalesVolume" Converter="{StaticResource decimalToFormatedStringConverter}" ConverterParameter="#,,.0M" />
</local:SalesPerformanceControl.FirstSalesVolume>
</local:SalesPerformanceControl>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6200 次 |
| 最近记录: |