纯粹在 xaml 中连接文字和静态资源字符串
我尝试了这个:
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}"
很好地解析为“Main App”,我如何成功地
- 将文字字符串“Show”添加
- 到来自
{Binding Source={StaticResource AppInfoer}, Path=Title}
的字符串输出,
我希望没有额外的代码隐藏解决方案,只涉及 xaml 行或两个?
i tried this:
Sets literally Show {Binding Source={StaticResource AppInfoer}, Path=Title}
<MenuItem Header="Show {Binding Source={StaticResource AppInfoer}, Path=Title}"
Command="{StaticResource ShowWindowCommand}" CommandParameter="Open" />
given Header="{Binding Source={StaticResource AppInfoer}, Path=Title}"
resolves nicely to "Main App", how could I successfully
- prepend the literal string "Show "
- to the string output from
{Binding Source={StaticResource AppInfoer}, Path=Title}
im hoping for a no additional code-behind solution, one that involves just an xaml line or two?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过使用 StringFormat?
Have you tried using StringFormat?