【发布时间】:2010-03-16 13:22:24
【问题描述】:
在我的 Silverlight 3 应用程序中,我创建了一个自定义工具提示,当鼠标悬停在饼图的一部分上时会显示该工具提示。显示的值是通过 TemplateBinding 设置的:
<ToolTipService.ToolTip>
<StackPanel>
<ContentControl Content="{TemplateBinding IndependentValue}" FontWeight="Bold" />
<ContentControl Content="{TemplateBinding FormattedDependentValue}"/>
<ContentControl Content="{TemplateBinding FormattedRatio}"/>
</StackPanel>
</ToolTipService.ToolTip>
工具提示显示饼图切片的标题、切片大小所基于的值以及占整个饼图的百分比:
我的名字
9
12%
现在,我想在值中添加一个常量字符串,以显示以下内容:
我的名字
9 项
12%
字符串“items”应添加到显示的数字中。有没有办法将常量字符串添加到 ContentControl 的 Content-Property 中? (我对绑定值FormattedDependentValue没有影响)
提前致谢, 弗兰克
【问题讨论】:
标签: c# silverlight