I'm trying to get vertical line annotations into my graph using MVVM. I have an AnnotationCollection on the ViewModel:
public AnnotationCollection Lines
{
get
{
if (_lines == null)
{
_lines= new AnnotationCollection();
foreach (var r in MyCollection)
{
_lines.Add(
new VerticalLineAnnotation() {
X1 = r.Xvalue,
VerticalAlignment = VerticalAlignment.Stretch,
Y1 = 0,
}
);
}
}
return _lines;
}
Which I bind to in my view:
<sci:SciChartSurface
...
Annotations="{Binding Lines}"
...
I know the binding is valid, because breakpoints hit in the getter (and it's not used anyplace else). I've examined the properties of the annotations, they seem to have a height, a width, a default Stroke and StrokeThickness. I've tried setting various additional properties manually. Yet whatever I do, the lines are never displayed on the graph. What am I doing wrong?
I've scoured the net for answers, but everything I've found so far seems to address older versions of SciChart API.