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 に設定します。

適用対象

こちらもご覧ください