【发布时间】:2014-09-10 11:01:12
【问题描述】:
我需要TextBlock中的无穷大符号
如果我在TextBlock.Text 中写"∞" 一切都好,在TextBlock“∞”符号中。
<TextBlock Text="∞"/>
但如果我使用Converter。
<TextBlock Text="{Binding MyValue, Converter={StaticResource MyConverter}}"/>
我在TextBlock 中有"&#8734;" 文本。
public class MyConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return "∞";
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
有什么解决办法吗?
【问题讨论】:
-
我相信在您的转换器中,您返回的是 XML 编码版本的无穷大,但它应该返回原始无穷大符号?
-
谢谢,Sliver2009 给出了答案
标签: c# windows-phone-8 unicode ivalueconverter