Pre loader

How to handle Mouse actions triggering multiple (custom) ZoomModifiers at once?

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

Answered
0
0
<sc:ModifierGroup x:Name="ChartZoom">
    <local:CustomZoomExtentsModifier/>
    <local:CustomYAxisDragModifier/>
    <local:CustomRubberBandXyZoomModifier/>
    <local:CustomMouseWheelZoomModifier />
    <sc:ZoomPanModifier ExecuteOn="MouseRightButton"/>
    <sc:TooltipModifier IsEnabled="True"/>
</sc:ModifierGroup>

I’ve got multiple ZoomModifiers and any MouseUp will trigger the eventhandlers on many of them (e.g. the MouseUp after dragging a RubberBand zoom will also trigger a YAxisDrag MouseUp event). Is there a way to prevent this? Or to know which Modifier really took effect on the chart?

Thanks!

Version
4.0.6.8583
  • You must to post comments
Best Answer
1
0

Hi Matthew,

In our own internal modifiers, we look at whether e.Handled is true on the mouse events to prevent events form being handled more than once.

This is actually done internally to SciChart so if modifier A should STOP events from propagating, it should set e.Handled = true in the OnModifierMouseUp handler.

Try that, it should work!

If, alternatively you want a modifier to receive handled events, set ChartModifierBase.ReceiveHandledEvents = true.

Best regards,
Andrew

  • 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