public override void OnKeyDown(KeyEventArgs e) { if (isDrawing && e.Key == Key.Escape) { endDraw(false, true); } base.OnKeyDown(e); }