protected virtual void AddPointsToStroke(Contact contact) { Stroke stroke = (Stroke)contact.GetUserData(key); if (stroke == null) StartStroke(contact); else { StylusPointCollection stylusPoints = stroke.StylusPoints; if (stylusPoints != null) { Point position = contact.GetPosition(this); stylusPoints.Add(new StylusPoint(position.X, position.Y, 0.5f)); } } }
protected virtual void EndStroke(Contact contact) { Stroke stroke = (Stroke)contact.GetUserData(key); if (stroke != null) { InkCanvasStrokeCollectedEventArgs args = new InkCanvasStrokeCollectedEventArgs(stroke); OnStrokeCollected(args); } }
private void RemovePartialStroke(Contact contact) { Stroke stroke = (Stroke) contact.GetUserData(key); if(stroke != null) { inkCanvas.Strokes.Remove(stroke); contact.SetUserData(key, null); } }