InkCanvas: How to erase by Stroke on right mouse click

1.7k Views Asked by At

I have an InkCanvas that works in the InkCanvasEditingMode.Ink. But I want to erase the entire stroke when the user presses the right button. Help me with an advise, please?

1

There are 1 best solutions below

1
On

I'm not sure which stroke you are willing to erase, but InkCanvas has a "Stokes" property that contains all strokes of the canvas. For example, to remove all strokes from canvas:

inkCanvas.Strokes.Clear() 

Now all you have to do is to puck the relevant one.