Pre loader

How to separate click events (OnModifierMouseUp) from SciChartSurface and other action like zoom/pan and annotation editing?

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’ve created my own modifier to do this and it was working perfectly in a previous version. It allowed dragging annotations and without events. Now it doesn’t catch events from the pan actions, but caches events from annotation editing.

class CustomPointSelectionModifier : SeriesSelectionModifier
{
    /// <inheritdoc />
    public override void OnModifierMouseUp(ModifierMouseArgs e)
    {
        base.OnModifierMouseUp(e);
        var xcalc = ParentSurface.XAxes.First().GetCurrentCoordinateCalculator();
        var ycalc = ParentSurface.YAxes.First().GetCurrentCoordinateCalculator();

        var poistionPoint = ParentSurface.RootGrid.TranslatePoint(Mouse.GetPosition((IInputElement)ParentSurface), ModifierSurface);
        var point = new Point()
        {
            X = xcalc.GetDataValue(poistionPoint.X),
            Y = ycalc.GetDataValue(poistionPoint.Y),
        };

        ((PlotBaseDescription)DataContext).OnMouseUp(e, point);
    }
}   

It is demonstrated in the attached example

Hot to achive it now?

Thanks.

Version
5.3.0.11954
  • You must to post comments
0
0

Hi Alexander,

The ModifierMouseArgs contains a property called Source, which tells you where the events are coming from.

OnModifierMouseUp should only fire when the mouse is down on the SciChartSurface and not handled by anything else. If anything handles the event (such as a previous modifier) then the event won’t be received, unless ChartModifierBase.ReceiveHandledEvents is true.

Try setting that property to true and inspecting the source of the ModifierMouseArgs. Does it help?

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