【发布时间】:2023-04-01 17:56:02
【问题描述】:
我想将我的字符串绑定格式化为Amount is X,其中X 是绑定到标签的属性。
我看过很多例子,但以下不起作用:
<Label Content="{Binding Path=MaxLevelofInvestment,
StringFormat='Amount is {0}'}" />
我也试过这些组合:
StringFormat=Amount is {0}
StringFormat='Amount is {}{0}'
StringFormat='Amount is \{0\}'
我什至尝试将绑定属性的数据类型更改为int、string和double。似乎没有任何效果。这是一个非常常见的用例,但似乎不受支持。
【问题讨论】:
标签: wpf wpf-controls binding wpftoolkit wpfdatagrid