Share via


InkPresenter.StrokeInput 属性

定义

获取用于管理墨迹输入事件的 InkStrokeInput 对象。

public:
 property InkStrokeInput ^ StrokeInput { InkStrokeInput ^ get(); };
InkStrokeInput StrokeInput();
public InkStrokeInput StrokeInput { get; }
var inkStrokeInput = inkPresenter.strokeInput;
Public ReadOnly Property StrokeInput As InkStrokeInput

属性值

墨迹输入。

示例

在这里,我们声明一个 StrokeStarted 侦听器。

inkCanvas.InkPresenter.StrokeInput.StrokeStarted += StrokeInput_StrokeStarted;

然后,我们定义相应的处理程序,该处理程序在启动新的墨迹笔划时清除任何选定的笔划。

private void StrokeInput_StrokeStarted(InkStrokeInput sender, Windows.UI.Core.PointerEventArgs args)
{
  var strokes = inkCanvas.InkPresenter.StrokeContainer.GetStrokes();
  foreach (var stroke in strokes)
  {
    stroke.Selected = false;
  }
  ClearDrawnBoundingRect();
}

适用于

另请参阅