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 Stackoverflow.com 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.

0
0
 private void VerticalLineAnnotation_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
    {
        if (e.PropertyName.Equals("PositionChanged"))
        {
            // Code here
        }
    }

I am trying to get the new Y1 intercept. I have bound this to both the VerticalLineAnnotations (y1 and y2 on those elements are NaN and null respectively) and to the VerticalSliceModifier which seems to give me the old values, instead of the new ones. I currently have this attached to the property changed event.

Essentially, the datacontext is staying the same but the collection is updating with new values. When it updates with new values, I need to update my LineAnnotation with the new Y1 and Y2 values.

Thanks!

  • You must to post comments
0
0

Hi Ryan,

Thanks for your question. I would suggest using WPF techniques such as overridding DependencyProperty’ metadata or DependencyPropertyDescriptor to listen to Y1 property changes. Please take a look at this msdn article which demonstrates how to achieve this using both techniques.

Besides, there are DragStarted/Ended/Delta events declared by annotations. They occur in respond to dragging an annotation by mouse. You may found them useful too.

Hope this helps!

Best regards,
Yuriy

  • You must to post comments
0
0

Yuriy’s answer is correct, however there are also events on AnnotationBase for handling drag start, change and end.

Please see this related questions: Can I get an event when the user drags a vertical line annotation?

Best regards,
Andrew

  • Ryan Woods
    I am actually using the DragDelta event because it is perfect for almost every situation I have except the reloading of the new data. I tried the load event as well and that didn’t fire when I loaded new data.
  • Andrew
    Can you clarify what you mean by loading new data and what the issue is? I guess when you create the annotation and place it on the screen, am I right? There is *IsHiddenChanged* however this will fire when the annotation is added, or, if it goes out of view. In an MVVM application you can simply bind TwoWay to X1 and this will work also.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.