مشاركة عبر


InkInputProcessingConfiguration.RightDragAction Property

Definition

Gets or sets how the InkPresenter object handles secondary input from a pen barrel button, pen eraser tip, right mouse button, or similar.

By default, this secondary input is processed as primary input and rendered as an InkStroke (see remarks).

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

Property Value

The input behavior when modified with a secondary affordance.

Examples

Here, we set RightDragAction to LeaveUnprocessed and declare UnprocessedInput event listeners for pointer input.

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

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

Here, we define the custom event handlers for pointer input. The handlers are used to implement ink stroke selection.

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();
}

Remarks

To pass input as UnprocessedInput through to your app for custom processing, set RightDragAction to LeaveUnprocessed.

Applies to

See also