I got the above problem resolved.
Dim annotation As New CartesianCustomLineAnnotation()
annotatio_index += 1
annotation.VerticalFrom = CDbl(0)
annotation.VerticalTo = CDbl(50)
annotation.HorizontalFrom = "9:00" // adding the string value for these properties solved the problem for me
annotation.HorizontalTo = "9:00"
annotation.Stroke = New SolidColorBrush(Colors.Red)
annotation.StrokeThickness = 3
We have added the context menu (Add VerticalLine & Delete Line) on which we are able to add/delete those lines.
I want to add vertical line on this position where user selects "Add Vertical Line" from context menu on the cartesianchart.
For example : If user right clicks at (x,y) = (10,50) then he gets a context menu there, when on selecting "Add vertical line", the line should be drawn at x=10 which we are currently hard coded as HorizontalTo=2 & HorizontalFrom=2
Could you please advise me or send a small solution.