Stylus.StylusInRange
Stylus.StylusInRange
Stylus.StylusInRange
Attached Event
定義
スタイラスがタブレットの範囲内に入ると発生します。Occurs when the stylus comes within range of the tablet.
see AddStylusInRangeHandler, and RemoveStylusInRangeHandler
see AddStylusInRangeHandler, and RemoveStylusInRangeHandler
see AddStylusInRangeHandler, and RemoveStylusInRangeHandler
例
次の例は、設定する方法を示します、EditingModeのプロパティ、InkCanvasにEraseByStrokeスタイラスが反転されます。The following example demonstrates how to set the EditingMode property of an InkCanvas to EraseByStroke when the stylus is inverted. この例では、InkCanvasと呼ばれるinkCanvas1
ことと、StylusInRangeイベントがイベント ハンドラーに接続されています。This example assumes that there is an InkCanvas called inkCanvas1
and that the StylusInRange event is connected to the event handlers. カーソルが変化を表示するには、設定、UseCustomCursorプロパティをtrue
でinkCanvas1
します。To see the cursor change, set the UseCustomCursor property to true
on inkCanvas1
.
void inkCanvas1_StylusInRange(object sender, StylusEventArgs e)
{
if (e.StylusDevice.Inverted == true)
{
inkCanvas1.EditingMode = InkCanvasEditingMode.EraseByStroke;
inkCanvas1.Cursor = System.Windows.Input.Cursors.Hand;
}
else
{
inkCanvas1.EditingMode = InkCanvasEditingMode.Ink;
inkCanvas1.Cursor = System.Windows.Input.Cursors.Pen;
}
}
Private Sub inkCanvas1_StylusInRange(ByVal sender As Object, ByVal e As StylusEventArgs) _
Handles inkCanvas1.StylusInRange
If e.StylusDevice.Inverted = True Then
inkCanvas1.EditingMode = InkCanvasEditingMode.EraseByStroke
inkCanvas1.Cursor = System.Windows.Input.Cursors.Hand
Else
inkCanvas1.EditingMode = InkCanvasEditingMode.Ink
inkCanvas1.Cursor = System.Windows.Input.Cursors.Pen
End If
End Sub 'inkCanvas1_StylusInRange
注釈
これは、添付イベントです。This is an attached event. WPFWPF ルーティング イベントとして添付イベントを実装します。implements attached events as routed events. 添付イベントは、基本的に、XAMLXAML言語の概念で、イベント、ないオブジェクトの処理自体を参照して、イベントを定義するために使用します。An attached event is, fundamentally, a XAMLXAML language concept used to reference events that are handled on objects that do not, themselves, define events. WPFWPF さらに、ルートを走査することができます、添付イベントの機能を展開します。further expands an attached event's capabilities, allowing it to traverse a route. アタッチされるイベントでは、コードでは、直接処理構文はありません。コード内でルーティング イベントのハンドラーをアタッチするには、指定された追加を使用して * ハンドラー メソッド。Attached events do not have a direct handling syntax in code; to attach handlers for a routed event in code, use a designated Add*Handler method. 詳細については、次を参照してください。添付イベントの概要します。For details, see Attached Events Overview.
ルーティングされたイベント情報Routed Event Information
識別子フィールドです。Identifier field | StylusInRangeEvent |
ルーティング方法Routing strategy | バブルBubbling |
DelegateDelegate | StylusEventHandler |
適用対象
こちらもご覧ください
フィードバック
お客様のご意見をお寄せください。 お寄せいただく内容の種類を選択:
このフィードバック システムは、GitHub Issues を利用して構築されています。 詳しくは、ブログをご覧ください。
フィードバックを読み込んでいます...