I want to use font awesome (http://fortawesome.github.io/Font-Awesome/design.html) in XAML.
I have been able to easily get it to work via direct XAML, by creating a fonts folder and adding the font there, then in XAML:
<TextBlock FontFamily="Fonts/#FontAwesome"></TextBlock>
Displays a martini glass icon.
However, when adding it programmatically it just shows and invalid symbol like so: []
, I tried the following:
XAML:
<TextBlock Name="textBlock"></TextBlock>
C#:
textBlock.FontFamily = new FontFamily("Fonts/#FontAwesome");
textBlock.Text = HttpUtility.HtmlDecode("");
and the following which returns the literal string:
textBlock.FontFamily = new FontFamily("Fonts/#FontAwesome");
textBlock.Text = "";
Any ideas?