我已经知道如何在wpf中执行此操作
<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 :(得分:0)
在文本值中使用十六进制值编码:
<system:String x:Key="myValue">
mm²
</system:String>