SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
Hi, SciChart team.
Our users can add many VerticalLineAnnotations to chart. Also they need to know what annotation is active. It is usefull for annotation removing for example.
What way schould I use for change visual style for selected annotation. By default selected annotation do not differ with not selected.
At this time I am modify AddAdorners RemoveAdorners(I am use MyCustom Annotaion inherited from VerticalLineAnnotation). And use different colors. But names of theese methods confuse me.
May be it is good idea to add methods like MakeSelected and MakeUnselected. Documentation in chm file is not helpfull for this situation.
You could use Triggers or Binding to achieve this, e.g.:
<Style x:Key="VerticalLineAnnotationStyle" TargetType="s:VerticalLineAnnotation"> <Setter Property="Stroke" Value="#FFFF6600" /> <Setter Property="StrokeThickness" Value="2" /> <Setter Property="ShowLabel" Value="True" /> <Setter Property="LabelPlacement" Value="Axis" /> <Setter Property="VerticalAlignment" Value="Stretch" /> <Style.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="Stroke" Value="Blue" /> </Trigger> </Style.Triggers> </Style>
This can be done from code too. Please, let us know if this solution is suitable for you or if you need any assistance!
Please login first to submit.