如何在 XAML 中放置一个 unicode 字符? [英] How to put a unicode character in XAML?

查看:30
本文介绍了如何在 XAML 中放置一个 unicode 字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试这样做:

<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?

推荐答案

由于 XAML 是一种 XML 文件格式,您可以尝试使用 XML 字符转义.因此,您可以编写 &#x2014; 而不是编写 &u2014.

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

这篇关于如何在 XAML 中放置一个 unicode 字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆