InkCanvas.StrokeErasing Evento

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 Custom Event StrokeErasing As InkCanvasStrokeErasingEventHandler 
Public Event StrokeErasing As InkCanvasStrokeErasingEventHandler 

Tipo de evento

InkCanvasStrokeErasingEventHandler

Ejemplos

En el ejemplo siguiente se evita que se borren los trazos representados como marcadores de resaltado.The following example prevents any strokes rendered as highlighters from being erased. En el ejemplo se da InkCanvas por supuesto que 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 debe borrar un trazo.Handle this event when you want to check whether a stroke should be erased. Establezca la Cancel propiedad en true si desea evitar que el trazo se borre.Set the Cancel property to true if you want to prevent the stroke from being erased. Puede utilizar esta técnica cuando la EditingMode propiedad o EditingModeInverted 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