Pre loader

How to get the new value of a VerticalLineAnnotation PositionChanged event

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

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 Burnett-Thompson
    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.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies