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.
- You must login to post comments
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
- Andrew Burnett-Thompson answered 5 years ago
- You must login to post comments
Please login first to submit.