InkCanvas.StrokeErasing Zdarzenie
Definicja
Występuje tuż przed wymazaniem pociągnięcia przez użytkownika.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
Typ zdarzenia
Przykłady
Poniższy przykład uniemożliwia wymazanie wszystkich pociągnięć renderowanych jako wyróżnienia.The following example prevents any strokes rendered as highlighters from being erased. W przykładzie przyjęto założenie, że InkCanvas jest połączony z programem obsługi zdarzeń.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
Uwagi
Obsłuż to zdarzenie, jeśli chcesz sprawdzić, czy pociągnięcia mają być wymazane.Handle this event when you want to check whether a stroke should be erased. Ustaw Cancel Właściwość na, true
Jeśli chcesz zapobiec wymazaniu pociągnięcia.Set the Cancel property to true
if you want to prevent the stroke from being erased. Tej techniki można użyć, gdy EditingMode Właściwość or EditingModeInverted jest ustawiona na EraseByStroke lub EraseByPoint .You can use this technique when the EditingMode or EditingModeInverted property is set to EraseByStroke or EraseByPoint.