Reputation: 15557
I'm creating a menu from a ListBox. I'm using FontAwesome to create some font-icons. This is part of the ListBox ItemTemplate
.
<TextBlock FontFamily="FontAwesome" VerticalAlignment="Center" HorizontalAlignment="Center"
FontSize="32" Text="{Binding MenuCode}"
ToolTip="{Binding Tooltip}" >
The problem resides within the TextBlock's Text. I need to display the symbol, not the menu code. So, for example, if I use Text=""
directly, then the music icon appears (fixed for all the items), but when I use DataBinding (each item has a different symbol): Text="{Binding MenuCode}"
then the text 
(that is, the menu code as string) appears (as text, no icon). I guess problem is related with encoding, but can't fix it. Any idea?
Upvotes: 0
Views: 97
Reputation: 26
Wrong escape sequence. HTML uses '#&x' while C# uses \u. So your "#&xF001" would become "\uF001"
Upvotes: 1