مشاركة عبر


InkPresenter.StrokesErased Event

Definition

Occurs when an InkStroke object is removed from an InkCanvas control using the pen eraser or the pen tip when Mode is set to Erasing.

// Register
event_token StrokesErased(TypedEventHandler<InkPresenter, InkStrokesErasedEventArgs const&> const& handler) const;

// Revoke with event_token
void StrokesErased(event_token const* cookie) const;

// Revoke with event_revoker
InkPresenter::StrokesErased_revoker StrokesErased(auto_revoke_t, TypedEventHandler<InkPresenter, InkStrokesErasedEventArgs const&> const& handler) const;
public event TypedEventHandler<InkPresenter,InkStrokesErasedEventArgs> StrokesErased;
function onStrokesErased(eventArgs) { /* Your code */ }
inkPresenter.addEventListener("strokeserased", onStrokesErased);
inkPresenter.removeEventListener("strokeserased", onStrokesErased);
- or -
inkPresenter.onstrokeserased = onStrokesErased;
Public Custom Event StrokesErased As TypedEventHandler(Of InkPresenter, InkStrokesErasedEventArgs) 

Event Type

Remarks

InkStrokeContainer.DeleteSelected does not cause this event to fire.

This event is not raised in custom dry mode (ActivateCustomDrying).

Custom drying and the InkToolbar By default, ink input is processed on a low-latency background thread and rendered "wet" as it is drawn. When the stroke is completed (pen or finger lifted, or mouse button released), the stroke is processed on the UI thread and rendered "dry" to the InkCanvas layer (above the application content and replacing the wet ink). The ink platform enables you to override this behavior and completely customize the inking experience by custom drying the ink input.

If your app overrides the default ink rendering behavior of the InkPresenter with a custom drying implementation, the rendered ink strokes are no longer available to the InkToolbar and the built-in erase commands of the InkToolbar do not work as expected. To provide erase functionality, you must handle all pointer events, perform hit-testing on each stroke, and override the built-in "Erase all ink" command.

For more info on custom drying, see Pen interactions and Windows Ink in UWP apps.

Applies to

See also