Share via


InkPresenter.StrokesErased 事件

定义

模式设置为“擦除”时,使用笔橡皮擦或笔尖从 InkCanvas 控件中删除 InkStroke 对象时发生。

// 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) 

事件类型

注解

InkStrokeContainer.DeleteSelected 不会导致此事件触发。

此事件不会在自定义干模式下引发, (ActivateCustomDrying) 。

自定义干燥和 InkToolbar 默认情况下,墨迹输入在低延迟的后台线程上进行处理,并在绘制墨迹时呈现为“湿”。 笔划完成时(抬起笔或手指,或者释放鼠标按钮),笔划将在 UI 线程上进行处理并向 InkCanvas 图层呈现“墨迹已干”(在应用程序内容之上,并且替换未干墨迹)。 墨迹平台支持你替代此行为并通过自定义烘干墨迹输入来完全自定义墨迹书写体验。

如果应用使用自定义干燥实现替代 InkPresenter 的默认墨迹呈现行为,则呈现的墨迹笔划不再可用于 InkToolbar并且 InkToolbar 的内置擦除命令无法按预期工作。 若要提供擦除功能,必须处理所有指针事件、在每个笔划上执行命中测试,并替代内置的“清除所有墨迹”命令。

有关自定义烘干的详细信息,请参阅 UWP 应用中的笔交互和 Windows Ink

适用于

另请参阅