InkCanvas.StrokeErasing InkCanvas.StrokeErasing InkCanvas.StrokeErasing InkCanvas.StrokeErasing Event

Definición

Se produce justamente antes de que un usuario borre un trazo.Occurs just before a user erases a stroke.

public:
 event System::Windows::Controls::InkCanvasStrokeErasingEventHandler ^ StrokeErasing;
public event System.Windows.Controls.InkCanvasStrokeErasingEventHandler StrokeErasing;
member this.StrokeErasing : System.Windows.Controls.InkCanvasStrokeErasingEventHandler 
Public Event StrokeErasing As InkCanvasStrokeErasingEventHandler 

Ejemplos

En el ejemplo siguiente, se impide que todos los trazos que se representan como marcadores de resaltado que se va a borrar.The following example prevents any strokes rendered as highlighters from being erased. El ejemplo supone que el InkCanvas está conectado al controlador de eventos.The example assumes that the InkCanvas is connected to the event handler.

void inkCanvas1_StrokeErasing(object sender, InkCanvasStrokeErasingEventArgs e)
{
    if (e.Stroke.DrawingAttributes.IsHighlighter)
    {
        e.Cancel = true;
    }
}
Private Sub inkCanvas1_StrokeErasing(ByVal sender As Object, _
                             ByVal e As InkCanvasStrokeErasingEventArgs)

    If (e.Stroke.DrawingAttributes.IsHighlighter) Then
        e.Cancel = True

    End If
End Sub

Comentarios

Controle este evento cuando desee comprobar si se debería borrar un trazo.Handle this event when you want to check whether a stroke should be erased. Establecer el Cancel propiedad true si desea impedir que el trazo que se va a borrar.Set the Cancel property to true if you want to prevent the stroke from being erased. Puede usar esta técnica cuando la EditingMode o EditingModeInverted propiedad está establecida en EraseByStroke o EraseByPoint.You can use this technique when the EditingMode or EditingModeInverted property is set to EraseByStroke or EraseByPoint.

Se aplica a