Sue*_*zio 3 data-binding silverlight wpf xaml string-formatting
我在Silverlight 4中工作,我试图在一个绑定到TextBlock的值中插入一个撇号:
<TextBlock Text="{Binding MyValue, StringFormat='The value is '{0}''}"/>
Run Code Online (Sandbox Code Playgroud)
但是,即使我尝试使用它\'并且"没有成功,我也会收到XAML解析错误.
这将在WPF或Silverlight中有效.
<Grid>
<Grid.Resources>
<system:String x:Key="Format">The value is '{0}'</system:String>
</Grid.Resources>
<TextBlock Text="{Binding MyValue, StringFormat={StaticResource Format}}"/>
</Grid>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
611 次 |
| 最近记录: |