SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.



I need to change CustomAnnotation visual view, when property IsSelected = true.

I tried next code:

<Style x:Key="CustomAnnotationStyle" TargetType="{x:Type sc:CustomAnnotation}">
    <Setter Property="IsEditable" Value="True"/>
        <Trigger Property="IsSelected" Value="True">
            <Setter Property="BorderBrush" Value="Orange"/>
            <Setter Property="BorderThickness" Value="2"/>

But it has no effect.
When I select the Annotation by mouse click, then it still have LightGreen rectangle.

In the Goal I need the Orange circle around of the Content of the Annotation.


  • You must to post comments
Best Answer

Hi Vyacheslav,

I’ve created a simple example which demonstrates the principle I was talking about in the comments.

CustomAnnotation is simply a container, it has no ‘body’. The CustomAnnotation.Content is the actual visual content displayed. So, if you want to change the CustomAnnotation border or strokethickness on selection, you must change the content border or strokethickness.

Here is an example (XAML)

<Window x:Class="WpfApplication33.MainWindow"
        Title="MainWindow" Height="350" Width="525">    
            <Style x:Key="CustomAnnotationStyle" TargetType="{x:Type s:CustomAnnotation}">
                <Setter Property="IsEditable" Value="True"/>
                <Setter Property="Tag" Value="1"/>
                <Setter Property="BorderBrush" Value="#FF00B400"/>
                <Setter Property="Background" Value="#571CB61C"/>
                    <Trigger Property="IsSelected" Value="True">
                        <Setter Property="BorderBrush" Value="White"/>                        
                        <Setter Property="Tag" Value="2"/>


                <s:CustomAnnotation Margin="0,15,0,0"
                                    Style="{StaticResource CustomAnnotationStyle}">
                    <Path Data="m 3.5 0.5 4 0 0 8 3 0 -5 5 -5 -5 3 0 z"                          
                          Fill="{Binding Background, RelativeSource={RelativeSource FindAncestor, AncestorType=s:CustomAnnotation}}"
                          Stroke="{Binding BorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType=s:CustomAnnotation}}"
                          StrokeThickness="{Binding Tag, RelativeSource={RelativeSource FindAncestor, AncestorType=s:CustomAnnotation}}" />


enter image description here

  • Vyacheslav Skripin
    Thanks. That is very helpful. I understand how it work right now .
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.