Looking at the documentation I’ve figured out how to style the content of the tooltip. But I can’t seem to figure out how to style the container.
You can see in the attached image the automatic blue background that matches the series. I would like to style it with our own style which is the dark background and then BorderBrush that matches the series color.
<DataTemplate x:Key="DigitalToolTipTemplate" DataType="s:XySeriesInfo">
<Border Style="{StaticResource BorderStyle}" BorderBrush="{Binding Stroke}">
<TextBlock Text="{Binding SeriesName, StringFormat='{}{0}'}" />
</Border>
</DataTemplate>
This seems to style only the inner contents of the tooltip but not the whole tooltip.
Also note the BorderBrush binding (not sure if this is correct to get the series color).
Update
Now using the following code (which is working) — Now the only thing I need to figure out is what to bind for the stroke to get the series color as the border stroke.
<Style x:Key="DigitalToolTipStyle" TargetType="s:TooltipControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="s:TooltipControl">
<Border Style="{StaticResource BorderStyle}" BorderBrush="{Binding Stroke}">
<ContentPresenter Content="{TemplateBinding DataContext}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
- Riley Huddleston asked 7 years ago
- last edited 7 years ago
- You must login to post comments
The key I was missing was that my data context is a SeriesInfo. So I simply bound the BorderBrush to the SeriesInfo’s Fill which is the series color.
- Riley Huddleston answered 7 years ago
- You must login to post comments
Please login first to submit.