在我的Silverlight 3应用程序中,我创建了一个自定义的Tooltip,当鼠标悬停在Pie-Chart的一部分上时显示。显示的值是通过TemplateBinding设置:Silverlight中的TemplateBinding和附加字符串
<ToolTipService.ToolTip>
<StackPanel>
<ContentControl Content="{TemplateBinding IndependentValue}" FontWeight="Bold" />
<ContentControl Content="{TemplateBinding FormattedDependentValue}"/>
<ContentControl Content="{TemplateBinding FormattedRatio}"/>
</StackPanel>
</ToolTipService.ToolTip>
工具提示显示扇形区的标题,值片的大小是根据与有关整个饼的百分比:
MyTitel
12%
现在,我想一个常量字符串添加到值,显示如下:
MyTitel
9项
12%
字符串 '项目' 应被添加到显示的号码。有没有办法将常量字符串添加到ContentControl的Content-Property? (我有绑定的值FormattedDependentValue没有影响)
由于提前, 弗兰克
我已经通过添加StackPanel解决了它。非常感谢! – Aaginor 2010-03-22 14:55:47