SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

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.