How to put Unicode character in XAML?

I am trying to do this:

<TextBlock Text="{Binding Path=Text, Converter={StaticResource stringFormatConverter}, ConverterParameter='&\u2014{0}'}" /> 

To receive - to appear before the text. This does not work. What should I do here?

+73
unicode wpf binding xaml
Sep 02 '09 at 11:43
source share
3 answers

Since XAML is an XML file format, you can try the XML escape code. So instead of writing &\u2014 , you can instead write &#x2014; .

+135
Sep 02 '09 at 12:15
source share

In xaml, I did it like this:

  <Button Grid.Column="1" Grid.RowSpan="2" Name="start" Margin="5" Click="start_Click"> <TextBlock Name="test" FontFamily="pack://application:,,,/Y_Yoga;Component/Resources/#FontAwesome">&#xF04B;</TextBlock> </Button> 

Hope to be helpful!

+7
May 24 '13 at 10:09
source share

From the Microsoft documentation :

Markup files created in Microsoft Visual Studio are automatically saved in Unicode UTF-8 format, which means that most special characters, such as accents, are correctly encoded. However, there is a set of commonly used special characters that are treated differently. These special characters follow the worldwide Web Consortium (W3C) XML standard for coding.

That means you can do zalgo for everyone you care.

enter image description here

A bit of code that matters:

 <Label Grid.Column="0" Grid.Row="3" FontWeight="ExtraBlack">STAGE:M&#x363;&#x36d;&#x363;&#x33e; V&#x363;&#x365;&#x36d;&#x35b;&#x364;&#x36e;&#x365;&#x368;&#x365;&#x367;&#x33e;</Label> 
+2
Mar 23 '16 at 9:34
source share



All Articles