Pre loader

How to capture pan or zoom events

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

I am using WPF with SciChart version 1.3.1.1107 and the MVVM pattern.
I am using a series of modifiers like the ZoomPanModifier in a similar manner to samples that you provide that I load from an attached behaviour.

I am adding a feature to adjust the visible range when new data points arrive that would not otherwise be visible; however, if a user pans the surface I want to detect that so I can stop adjusting the visible range.

My thinking is that I need to capture a mouse event either associated with the chart to the current modifier; however, nothing I seem to do allows me to capture a mouse event. If their is a better way I am open to that as well.

  • You must to post comments
0
0

Hi Sam,

You can try this technique: http://http://www.scichart.com/questions/question/sharing-mouse-events-one-way/

Someone asked only yesterday how to prevent mouse events going from one chart to another. The solution was to override OnModifierMouseMove on the modifier in question and selectively call the base method.

It would be verbose but if you created derived types of the modifiers you are using, then overrode the OnModifierMouseDown, OnModifierMouseMove, OnModifierMouseUp events you could detect mouse on specific modifiers.

Another method – a lot simpler – you can subscribe to ((Grid)SciChartSurface.RootGrid).PreviewMouseDown and in there, stop adjusting visible range. Then subscribe to MouseDoubleClick to restore visible range adjustment.

Can you try those and let me know how you get on?

  • You must to post comments
Showing 1 result
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