[英]How to superscript a string in Application.Resources
我已經知道如何在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>
或這個答案 ,或在代碼中
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}" />
在文本值中,使用十六進制值編碼:
<system:String x:Key="myValue">
mm²
</system:String>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.