InkInputProcessingConfiguration.RightDragAction 属性

定义

获取或设置 InkPresenter 对象如何处理笔筒按钮、笔橡皮擦笔尖、鼠标右键或类似的辅助输入。

默认情况下,此辅助输入作为主输入进行处理,并呈现为 InkStroke (请参阅注释) 。

public:
 property InkInputRightDragAction RightDragAction { InkInputRightDragAction get(); void set(InkInputRightDragAction value); };
InkInputRightDragAction RightDragAction();

void RightDragAction(InkInputRightDragAction value);
public InkInputRightDragAction RightDragAction { get; set; }
var inkInputRightDragAction = inkInputProcessingConfiguration.rightDragAction;
inkInputProcessingConfiguration.rightDragAction = inkInputRightDragAction;
Public Property RightDragAction As InkInputRightDragAction

属性值

使用辅助提供项进行修改时的输入行为。

示例

在这里,我们将 RightDragAction 设置为 LeaveUnprocessed ,并为指针输入声明 UnprocessedInput 事件侦听器。

inkCanvas.InkPresenter.InputProcessingConfiguration.RightDragAction = 
  InkInputRightDragAction.LeaveUnprocessed;

inkCanvas.InkPresenter.UnprocessedInput.PointerPressed += 
  UnprocessedInput_PointerPressed;
inkCanvas.InkPresenter.UnprocessedInput.PointerMoved += 
  UnprocessedInput_PointerMoved;
inkCanvas.InkPresenter.UnprocessedInput.PointerReleased += 
  UnprocessedInput_PointerReleased;

此处,我们定义指针输入的自定义事件处理程序。 处理程序用于实现墨迹笔划选择。

private void UnprocessedInput_PointerPressed(InkUnprocessedInput sender, Windows.UI.Core.PointerEventArgs args)
{
  lasso = new Polyline()
  {
    Stroke = new SolidColorBrush(Windows.UI.Colors.Blue),
    StrokeThickness = 1,
    StrokeDashArray = new DoubleCollection() {5, 2},
  };

  lasso.Points.Add(args.CurrentPoint.RawPosition);

  selectionCanvas.Children.Add(lasso);
}

private void UnprocessedInput_PointerMoved(InkUnprocessedInput sender, Windows.UI.Core.PointerEventArgs args)
{
  lasso.Points.Add(args.CurrentPoint.RawPosition);
}

private void UnprocessedInput_PointerReleased(InkUnprocessedInput sender, Windows.UI.Core.PointerEventArgs args)
{
  lasso.Points.Add(args.CurrentPoint.RawPosition);

  boundingRect = inkCanvas.InkPresenter.StrokeContainer.SelectWithPolyLine(lasso.Points);

  DrawBoundingRect();
}

注解

若要将输入作为 UnprocessedInput 传递到应用进行自定义处理,请将 RightDragAction 设置为 LeaveUnprocessed

适用于

另请参阅