如何通过绑定将DataTemplate Unicode字符放入?

MyW*_*Way 1 c# unicode xaml windows-phone-7.1

我试着更深入地描述我的问题.我有完整列出的项目 ObservableCollection<show>,在某些情况下,我需要在列表框项目区域显示正确值的DIAMETER SIGN.

例如

在此输入图像描述

如果我想在每个框中都有它,我会把它硬编码或用硬编码值绑定,但只有部分项目具有应该用直径符号显示的值.这是show类的代码片段,它应该返回正确的符号

public string Thickness 
        {
            get 
            {
                if (thickness == 1)
                {
                    return "&#x2300;28cm";
                }
                else if (thickness == 2)
                {
                    return "&#x2300;50cm";
                }
                else 
                { 
                    return ""; 
                }
            }
        }
Run Code Online (Sandbox Code Playgroud)

和我的代码片段来自xaml

  <TextBlock  
         Foreground="#69AB5C"
         FontSize="15" 
         VerticalAlignment="Bottom"
         Text="{Binding Thickness}">
  </TextBlock>
Run Code Online (Sandbox Code Playgroud)

在这里我应该如何从我的可观察集合中将unicode字符传递给xaml

XAM*_*MAX 7

哈利路亚!

这是您的财产中的解决方案改变它

return "&#x2300;50cm";
Run Code Online (Sandbox Code Playgroud)

return ((char)0x2300).ToString();
Run Code Online (Sandbox Code Playgroud)

对于50cm部分你总是可以使用多重绑定或使用char数组并将其绑定到它.:-)