I'm trying to set up a SciChart VerticalLineAnnotation similar to the Drag Horizontal Threshold example in the SciChart example suite. I have the annotation bound to a property in my view model, but when dragging the annotation it continually sets the property to a value of 0.
I've tried setting the property value in code and it does move the line as you would expect indicating the binding is fine. I set a breakpoint on the property and confirmed the 0 value is coming from the control, not my code.
<sc:SciChartSurface x:Name="OverviewSurface"
Margin="5,2,5,2"
Background="White"
Grid.Row="2"
Grid.ColumnSpan="4"
Loaded="OnOverviewSurfaceLoaded"
RenderableSeries="{Binding ElementName=ChartSurface, Path=RenderableSeries}"
YAxes="{sc:AxesBinding YAxes}">
<sc:SciChartSurface.XAxis>
<sc:NumericAxis VisibleRange="{Binding VisibleRange}" DrawMajorGridLines="False" DrawMinorGridLines="False" DrawMajorBands="False" Visibility="Collapsed"/>
</sc:SciChartSurface.XAxis>
<sc:SciChartSurface.Annotations>
<sc:VerticalLineAnnotation VerticalAlignment="Stretch"
IsEditable="True"
ShowLabel="False"
Stroke="#FF42b649"
StrokeThickness="4"
YAxisId="ChannelA"
X1="{Binding SelectedIndex, Mode=TwoWay}" />
</sc:SciChartSurface.Annotations>
</sc:SciChartSurface>
I expect that when I drag the Annotation along the horizontal length of the chart that I will get a value corresponding with the X position placed in SelectedIndex, but all I ever get is zero.