MyW*_*Way 1 c# unicode xaml windows-phone-7.1
我试着更深入地描述我的问题.我有完整列出的项目 ObservableCollection<show>
,在某些情况下,我需要在列表框项目区域显示正确值的DIAMETER SIGN.
例如
如果我想在每个框中都有它,我会把它硬编码或用硬编码值绑定,但只有部分项目具有应该用直径符号显示的值.这是show类的代码片段,它应该返回正确的符号
public string Thickness
{
get
{
if (thickness == 1)
{
return "⌀28cm";
}
else if (thickness == 2)
{
return "⌀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
哈利路亚!
这是您的财产中的解决方案改变它
return "⌀50cm";
Run Code Online (Sandbox Code Playgroud)
至
return ((char)0x2300).ToString();
Run Code Online (Sandbox Code Playgroud)
对于50cm
部分你总是可以使用多重绑定或使用char数组并将其绑定到它.:-)