在我的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