C# 纯粹在xaml中连接文本和静态资源字符串

C# 纯粹在xaml中连接文本和静态资源字符串,c#,wpf,xaml,binding,C#,Wpf,Xaml,Binding,我试过这个: Sets literally Show {Binding Source={StaticResource AppInfoer}, Path=Title} <MenuItem Header="Show {Binding Source={StaticResource AppInfoer}, Path=Title}" Command="{StaticResource ShowWindowCommand}" CommandParameter="Open" /> set字面上显

我试过这个:

Sets literally Show {Binding Source={StaticResource AppInfoer}, Path=Title}
<MenuItem Header="Show {Binding Source={StaticResource AppInfoer}, Path=Title}" 
Command="{StaticResource ShowWindowCommand}" CommandParameter="Open" />
set字面上显示{Binding Source={StaticResource AppInfoer},Path=Title}
给定
Header=“{Binding Source={StaticResource AppInfoer},Path=Title}”
很好地解析为“Main App”,我怎么能成功呢

  • 在文字字符串“Show”前面加上前缀
  • {Binding Source={StaticResource AppInfoer},Path=Title}
我希望没有额外的代码隐藏解决方案,一个只涉及一两行xaml的解决方案。

您试过使用吗


谢谢,但当我在MenuItem头中复制你的代码时,它只显示“主应用程序”?i、 e.它不在“Show”前面。可能
MenuItem
Header
不支持
StringFormat
?最后,让它与替代实现一起工作
内部类PrependConverter:IValueConverter{public object Convert(object value,System.Type targetType,object parameter,System.Globalization.CultureInfo culture){return string.Format(“Show{0}”,value);}/…}
和XAML
plus
{Binding Source={StaticResource AppInfoer}, Path=Title, StringFormat=Show {0}}