Search code examples
wpfxamlunicodebinding

How to put a unicode character in XAML?


I'm trying to do this:

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

To get a — to appear in front of the text. It doesn't work. What should I be doing here?


Solution

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