Windows Universal Applications – Programmatically change Segoe MDL2 Assets icon

When trying to change an icon in a TextBox using the Segoe MDL2 Assets, it just give me some ugly squares.

The solution is to use the escape character followed by the Unicode representation of the icon.

MyTextBox.Content = "\uE71A";

And not to use the classical notation &#…

Thanks to this guy :

Windows 10 – Windows Universal App icons

Just a post it to this page that contains guidelines and is like a cheat sheet for the icons that developers can use with Windows Universal Apps, using the Segoe MDL2 AssetsĀ font.

Also this page

Usage example:

<Button FontFamily="Segoe MDL2 Assets" Content="& #xE001;" FontSize="36"/>

Note REMOVE THE SPACE CHARACTER in the content. I added thisĀ because it wasn’t readable otherwise…