InkInputProcessingConfiguration.RightDragAction 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定 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。