Pre loader

MouseEvents for YAxisDragModifier

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

Hi,

I’m using the YAxisDragModifier to pan one or more Yaxis.

// Add a new YAxisDragModifier for this axis
var yAxisDragModifier = new YAxisDragModifier();
yAxisDragModifier.DragMode = AxisDragModes.Pan;
yAxisDragModifier.AxisId = axisId;
yAxisDragModifier.ReceiveHandledEvents = true;
yAxisDragModifier.MouseUp += new System.Windows.Input.MouseButtonEventHandler(yAxisDragModifier_MouseUp);
yAxisDragModifier.MouseDown += new System.Windows.Input.MouseButtonEventHandler(yAxisDragModifier_MouseDown);
                this.ChartModifier.ChildModifiers.Add(yAxisDragModifier);

I like to capture the MouseUp event, but it won’t work.
How can I do this?

Thanks and best regards,
Egbert

  • You must to post comments
0
0

Hi Egbert,

The Modifiers are not in the visual tree. We use some special techniques to route mouse events to them and allow databinding while not held in the visual tree.

May I suggest subclassing YAxisDragModifier and overriding OnModifierMouseDown, OnModifierMouseMove, OnModifierMouseUp. Ensure you call the base method in each override.

There you will see if you set a breakpoint in these override methods that these are hit on mouse interaction. You could add your own event here to notify subscribers that a change has occurred.

Best regards,
Andrew

  • EJansen
    Hi Andrew, This works. Thanks.... Best regards, Egbert
  • 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