Reputation: 3336
I have a Label
with Font
set to an icons font (font awesome) which has the Text
bound like this:
<Label Text='{Binding Icon}'>
<Label.FontFamily>
<OnPlatform x:TypeArguments="x:String">
<OnPlatform.iOS></OnPlatform.iOS>
<OnPlatform.Android>icons.ttf#Icons</OnPlatform.Android>
</OnPlatform>
</Label.FontFamily>
</Label>
it doesn't render the icon, it renders the Unicode value 
instead.
It works if I set the text without binding, like this:
<Label Text=''>
I suspect there's some kind of race condition between setting the text and the font.
I need the binding, but I don't know any workarounds.
Upvotes: 5
Views: 1238
Reputation: 5122
SushiHangover's works in my case but if you're using Font Awesome Material Design Icons (referenced in my XAML as materialdesignicons.ttf#Material Design Icons
) or any Unicode character that exceeds 0xFFFF, you need to use a syntax like this:
"\U000F09D7"
Upvotes: 0
Reputation: 74094
Return the escape sequence of \uf032
from your binding instead of instead of 
Upvotes: 9