c# - 我们可以有一个包含默认值 + 绑定数据的内容吗?
问题描述
我想知道 WPF 中是否有可能执行以下操作:
<Label Content="ValueWhoNeverChange + {Binding MyTargetValue}"/>
解决方案
您可以使用ContentStringFormat属性,例如
<Label Content="{Binding Path=MyTargetValue}"
ContentStringFormat="ValueWhoNeverChange {0}" />
我希望它可以帮助你。
推荐阅读
- php - Voyager - 浏览时显示的特定列
- jenkins - Jenkins 无法使用 https 和 SSL 连接 SonarQube
- ios - 如何在 Firestore Objective-c 上设置/更新数据时以秒为单位获取 Firebase 服务器时间?
- rest - 无法更新数据
- php - 标头不起作用显示错误标头已发送
- python - 如何修复 TreeTagger:参数文件无效:python 中的 english.par
- vb.net - 无法通过 API 422 错误向 Sage One 发布发票
- powershell - 如果我的代码需要在 Windows 服务器上运行,如何构建 gitlab 管道?
- sql-server - if update() 语句如何在 SQL Server 的更新触发器中工作?
- tvos - TVCardView 的 focusSizeIncrease 不起作用?