2013-07-17 18 views
0

我已經宣佈在Application.Resources資源像靜態資源的的StringFormat不是文本框工作

<sys:String x:Key="DecimalFormat">\{0:F2\}</sys:String> 

現在我給這個靜態資源作爲的StringFormat但它不工作。我也嘗試了stringFormat應用程序中斷的綁定。有沒有我想讓stringformat動態。

回答

0

爲資源

<sys:String x:Key="DecimalFormat">{0:F2}</sys:String> 

<TextBlock Text="{Binding MyDecimal, StringFormat={StaticResource DecimalFormat}}" /> 
定義時使用它沒有斜槓