Segoe UI Symbol smiley is sometimes colorful, some

2019-09-10 03:08发布

问题:

I have the following problem with my smileys:

<!-- Displays a colorful smiley -->
<PivotItem Header="Add &#x1F636;" FontFamily="Segoe UI Symbol">

<!-- Displays a black & white smiley -->
<TextBlock Text="&#x1F636;" FontFamily="Segoe UI Symbol"/>

How do I get a nice colorful smiley in a TextBlock? Is it a particularity of the TextBlock? Should I use another component to display this text... and if so, which one? Thanks!

Edit1: the top (yellow and white) smiley is the one of the pivot item, the red and transparent one are the textblocks. It's basically the background that I want to have in color, not the foreground:

Edit2: I just tried to use a TextBox instead of a TextBlock and the icon appears in color... it slowly starts to hint toward a TextBlock problem...

_Edit3: It still doesn't work, but at least I have found a way to go around the problem. See here for the solution.

回答1:

Use Foreground property to define color of the text. Like in the example:

<TextBlock Text="&#x1F636;" Foreground="Navy" FontFamily="Segoe UI Symbol"/>