Help: Mouse Event in Annotation

Oct 15, 2013 at 2:31 PM
Edited Oct 15, 2013 at 2:32 PM
Hello guys!

In my plot I have a PolygonAnnotation, and I also have a line crossing this Polygon, I wanna trigger a action only if I click in the Polygon, not if I click in the line crossing the polygon ...

Doing like that:
var pa = new PolygonAnnotation
                {
                    Layer = AnnotationLayer.BelowAxes,
                    Points = annotationPolygon,
                    Color = OxyColors.Black,
                    Fill = OxyColors.Transparent,

                };  

pa.MouseDown += (s, e) =>
            {
                if (e.ChangedButton != OxyMouseButton.Left)
                {
                    return;
                }

               myAction();
               
                PlotModel.InvalidatePlot(false);
            };
In this way, when I click inside the polygon the action triggers, but if I click in a line crossing the polygon the action also triggers (probably because the line are inside the polygon), but I do not want that, its possible to solve this?
Oct 15, 2013 at 3:03 PM
Ok, I made a workaround using the shift button ... thx
Oct 15, 2013 at 9:10 PM
Did you try setting e.Handled = true?