wp7中的StringFormat?

tri*_*kui 4 silverlight windows-phone-7

有没有办法在一个TextBlock中组合静态文本和绑定?因为StringFormat在Windows Phone 7中不起作用.我试试

<TextBlock Text="{Binding strAudioArtistName, StringFormat=StaticText: {0}}"/>
Run Code Online (Sandbox Code Playgroud)

但不要工作....

谢谢

Chr*_*nty 7

实际上,如果你可以改变你的viewmodel并在属性中进行格式化,你将获得比依赖IValueConverter更好的性能.

我沿着这些线使用一个模式仍然给我属性更改通知

string _value;
public string Value { get { return _value; } set { _value = value; NotifyPropertyChanged("Value"); NotifyPropertyChanged("ValueFormatted"); } }
public string ValueFormatted { get { return "Static Text: " + _value; } }


dec*_*one 5

WP7用途Silverlight 3.所以,你没有得到StringFormat.请IValueConverter改用.