public override bool OnPointerUp(AnnContainer sender, AnnPointerEventArgs e) { LeadPointCollection points = TargetObject.Points; if (_clickCount > 3) { points.Add(_end); //we want to add point at the end to infrom us that drawing finished EndWorking(); } return(true); }
public override bool OnPointerDown(AnnContainer sender, AnnPointerEventArgs e) { bool handled = base.OnPointerDown(sender, e); if (e.Button != AnnMouseButton.Left) { return(handled); } _clickCount++; if (e.Button == AnnMouseButton.Left) { LeadPointD _begin = ClipPoint(e.Location, ClipRectangle); _end = _begin; LeadPointCollection points = TargetObject.Points; if (_clickCount == 1) { points.Add(_begin); points.Add(_end); } else if (_clickCount % 2 != 0) { points.Add(_begin); points.Add(_end); } StartWorking(); handled = true; } return(handled); }