【发布时间】:2013-06-03 07:14:34
【问题描述】:
我有这个BubbleChart,我想在其中添加一个Style 来显示ToolTip。当我这样做时,ToolTip 就在那里,一切都很好,直到我添加了第二个系列 - 现在以前的颜色设置(每个系列都有不同的颜色)已经消失,每个系列都有相同的颜色。有人知道要绑定系列的默认颜色吗?
我尝试了Template Binding,但它不起作用。
<Style x:Key="BubbleToolTipTemplate" TargetType="{x:Type c:BubbleDataPoint}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="c:BubbleDataPoint">
<Grid RenderTransformOrigin=".5,.5">
<Grid.RenderTransform>
<ScaleTransform ScaleX=".75" ScaleY=".75" />
</Grid.RenderTransform>
<!-- This Ellipse should bind on the default color -->
<Ellipse Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" />
<ContentPresenter Content="{TemplateBinding Size}" HorizontalAlignment="Center" VerticalAlignment="Center" />
<ToolTipService.ToolTip>
<StackPanel>
<ContentControl Content ="{ TemplateBinding DependentValue, Converter={StaticResource DoubleToStringConverter}}" />
<ContentControl Content ="{ TemplateBinding IndependentValue}"/>
<ContentControl Content ="{ TemplateBinding Size }" />
</StackPanel>
</ToolTipService.ToolTip>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
也许以前有人处理过这个!任何帮助表示赞赏!
【问题讨论】:
标签: c# wpf wpftoolkit silverlight-toolkit