InkPresenter.StrokesErased Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
// 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
- Pen and stylus interactions
- Get started: Support ink in your UWP app
- Ink analysis sample (basic) (C#)
- Ink handwriting recognition sample (C#)
- Save and load ink strokes from an Ink Serialized Format (ISF) file
- Save and load ink strokes from the clipboard
- Ink toolbar location and orientation sample (basic)
- Ink toolbar location and orientation sample (dynamic)
- Coloring book sample
- Family notes sample
- Inking sample (JavaScript)
- Simple inking sample (C#/C++)
- Complex inking sample (C++)
- Ink analysis sample