TemplateBinding and additional string in Silverlight

Posted by aaginor on Stack Overflow See other posts from Stack Overflow or by aaginor
Published on 2010-03-16T13:22:24Z Indexed on 2010/03/16 13:26 UTC
Read the original article Hit count: 291

Filed under:
|

Hi folks,

In my Silverlight 3 application, I created a custom Tooltip, that is shown when the mouse is over a part of a Pie-Chart. The displayed values are set via TemplateBinding:

<ToolTipService.ToolTip>
  <StackPanel>
    <ContentControl Content="{TemplateBinding IndependentValue}" FontWeight="Bold" />
    <ContentControl Content="{TemplateBinding FormattedDependentValue}"/>
    <ContentControl Content="{TemplateBinding FormattedRatio}"/>
  </StackPanel>
</ToolTipService.ToolTip>

The tooltip shows the title of the pie-slice, the value that the size of the slice is based on and the percentage regarding the whole pie:

MyTitel

9

12%

Now, I want to add a constant string to the value, to show the following:

MyTitel

9 items

12%

the string 'items' shall be added to the displayed number. Is there a way to add the constant string to the Content-Property of the ContentControl? (I have no influence on the binded value FormattedDependentValue)

Thanks in advance, Frank

© Stack Overflow or respective owner

Related posts about c#

Related posts about Silverlight