开发者

Concatenate literals and staticresource string purely in 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={StaticReso开发者_运维百科urce 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?


Have you tried using StringFormat?

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜