I am trying to make a Grid with an Icon in it. I am storing the string representation of the icon in a database, and trying to display these icons in a GridHub by binding to the Icon property (a string) on my viewmodel.
When I use this xaml, I get the actual text displayed in the grid
<TextBlock Text="{Binding Icon}"
FontFamily="Segoe UI Symbol"
FontSize="100"
TextAlignment="Center"
VerticalAlignment="Top"
Foreground="DarkGray"
AutomationProperties.Name="Some Label"/>
But this displays the icon as expected
<TextBlock Text=""
FontFamily="Segoe UI Symbol"
FontSize="100"
TextAlignment="Center"
VerticalAlignment="Top"
Foreground="DarkGray"
AutomationProperties.Name="Some Label"/>
My Model looks like:
public class PermissionGroup
{
/// <summary>
/// The unique identifier for the group.
/// </summary>
public string PermissionGroupId { get; set; }
/// <summary>
/// The name of the group
/// </summary>
public string Name { get; set; }
/// <summary>
/// The page associated with the permission group
/// </summary>
public string PageName { get; set; }
/// <summary>
/// The icon that will be shown on the PermissionHub page
/// </summary>
public string Icon { get; set; }
/// <summary>
/// A description of the permissions in the group
/// </summary>
public string Description { get; set; }
/// <summary>
/// The permissions associated with this permission group
/// </summary>
public List<Permission> Permissions { get; set; }
}
and my viewmodel just contains a list of these objects.
In my database I have tried storing the following:

- \uE1D4 (has to be escaped to get in the db)
- 57812 (the result of
char.Parse("\uE1D4")
)
and none of these has resulted in the icon being displayed correctly!