2014-09-04 58 views
0

我已經知道如何做到這一點在WPF作爲如何在上標一個Application.Resources串

<TextBlock HorizontalAlignment="Left" Margin="359,10,0,0" 
      TextWrapping="Wrap" VerticalAlignment="Top" Width="75"> 
    <Run>X</Run> 
    <Run BaselineAlignment="Superscript" FontSize="8">4</Run> 
</TextBlock> 

this answer,或在代碼中

string area; 
area = "mm\xB2"; 
testTblock.Text = area; 

但是你可以怎麼做在Application.Resources中?作爲

<Application.Resources> 
<System:String x:Key="area"> 
    //what should be here? 
</System:String> 

,這樣我可以把它應用到DynamicResource爲

<TextBlock Text="{DynamicResource area}" /> 

回答

0

在文本值使用十六進制值編碼:

<system:String x:Key="myValue"> 
    mm&#xB2; 
</system:String> 
+0

謝謝@ValeriuCaraulea。 – Bopy 2014-09-05 11:51:18

相關問題