I'm trying to show "H2O" with the 2 in subscript in a PivotItem Header.
E.g.
<controls:PivotItem Header="H20">
</controls:PivotItem>
I'd also like to assign the same value from code behind to TextBlock.Text.
E.g.
textBlock1.Text = "H2O"; // 2 to appear as subscript.
Is this possible with the version of Silverlight used for WP7?
After some searching around I found a solution.
From SubScript and SuperScript in TextBlock by Troels Pedersen and lordcheeto respectively.
In the XAML the subscript 2 can be expressed via Unicode.
E.g.
And similarly for the code behind.
E.g.
There are some limitations on this approach as only characters in the Basic Multilingual Plane (0000-FFFF) are supported and the font being used also needs to support the characters.