我有一个 ListView
,里面有多个 TextBlock
。有可能有这样的东西吗?
TextBlock x:Name="AuthorInfo" Text="Author: {Binding data.author}"
还是在设置时将其添加到 data.author 会更好?
最佳答案
如果是 XAML,您可以使用 StringFormat
<TextBox Text="{Binding Path=data.author, StringFormat=Author: {0}}"/>
关于c# - 将TextBlock的文本设置为字符串加绑定(bind)项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13214194/