C# 多图表样式-单个颜色
我有一个C# 多图表样式-单个颜色,c#,wpf,wpftoolkit,silverlight-toolkit,C#,Wpf,Wpftoolkit,Silverlight Toolkit,我有一个BubbleChart,我想添加一个单独的样式,以显示工具提示。当我这样做时,工具提示就在那里,一切都很好,直到我添加了第二个系列-现在以前的颜色设置(每个系列都有不同的颜色)消失了,每个系列都有相同的颜色。是否有人知道要在序列的默认颜色上绑定 我尝试了模板绑定,但它不起作用 <Style x:Key="BubbleToolTipTemplate" TargetType="{x:Type c:BubbleDataPoint}"> <Setter Property
BubbleChart
,我想添加一个单独的样式
,以显示工具提示
。当我这样做时,工具提示就在那里,一切都很好,直到我添加了第二个系列-现在以前的颜色设置(每个系列都有不同的颜色)消失了,每个系列都有相同的颜色。是否有人知道要在序列的默认颜色上绑定
我尝试了模板绑定
,但它不起作用
<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>
也许以前有人处理过!感谢您的帮助 好的,我找到了解决办法
在后台有generic.xaml,您可以在其中找到Bubbledatapoint的默认样式(您可以找到它)
当我通读这篇文章时,我发现了调色板资源。后来我试着把这些颜色粘在一起,直到我找到了窍门
只需将椭圆的fill属性设置为{DynamicResource Background}”