纯在xaml中连接字面量和静态源字符串

本文关键字:静态 字符串 xaml 连接 纯在 | 更新日期: 2023-09-27 18:08:24

我试过了:

Sets literally Show {Binding Source={StaticResource AppInfoer}, Path=Title}
<MenuItem Header="Show {Binding Source={StaticResource AppInfoer}, Path=Title}" 
Command="{StaticResource ShowWindowCommand}" CommandParameter="Open" />

给定Header="{Binding Source={StaticResource AppInfoer}, Path=Title}"很好地解析为"主应用程序",我如何才能成功

  • 在字符串"Show "前加上字符
  • {Binding Source={StaticResource AppInfoer}, Path=Title}
  • 的字符串输出

我希望没有额外的代码滞后解决方案,一个涉及只是一个xaml行或两个?

纯在xaml中连接字面量和静态源字符串

您是否尝试过使用StringFormat?

{Binding Source={StaticResource AppInfoer}, Path=Title, StringFormat=Show {0}}