InputBinding.Gesture プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
この入力バインドに関連付けられる InputGesture を取得または設定します。
public:
virtual property System::Windows::Input::InputGesture ^ Gesture { System::Windows::Input::InputGesture ^ get(); void set(System::Windows::Input::InputGesture ^ value); };
public virtual System.Windows.Input.InputGesture Gesture { get; [System.Security.SecurityCritical] set; }
public virtual System.Windows.Input.InputGesture Gesture { get; set; }
[<set: System.Security.SecurityCritical>]
member this.Gesture : System.Windows.Input.InputGesture with get, set
member this.Gesture : System.Windows.Input.InputGesture with get, set
Public Overridable Property Gesture As InputGesture
プロパティ値
関連付けられたジェスチャ。 既定値は、null
です。
- 属性
例
次の例では、 を使用 KeyBinding して を にバインド KeyGesture する方法を RoutedCommand示します。 Alt + L キーを KeyGesture 押すと、 Close コマンドが呼び出されます。
<KeyBinding Modifiers="Alt"
Key="L"
Command="ApplicationCommands.Close" />
KeyGesture CloseCmdKeyGesture = new KeyGesture(
Key.L, ModifierKeys.Alt);
KeyBinding CloseKeyBinding = new KeyBinding(
ApplicationCommands.Close, CloseCmdKeyGesture);
this.InputBindings.Add(CloseKeyBinding);
Dim CloseCmdKeyGesture As New KeyGesture(Key.L, ModifierKeys.Alt)
Dim CloseKeyBinding As New KeyBinding(ApplicationCommands.Close, CloseCmdKeyGesture)
Me.InputBindings.Add(CloseKeyBinding)
注釈
入力ジェスチャは、 コマンドを呼び出すアクションです。 WPF の入力ジェスチャの例として、 と MouseGestureがありますKeyGesture。 は KeyGesture 、 と の Key セット ModifierKeysの組み合わせです。 は MouseGesture 、 と の MouseAction セット ModifierKeysの組み合わせです。
クラス自体は InputBinding XAML の使用をサポートしていません。これは、パブリック パラメーターなしのコンストラクターを公開しないためです (パラメーターなしのコンストラクターは存在しますが、保護されています)。 ただし、派生クラスはパブリック コンストラクターを公開できるため、XAML を使用して から InputBinding 継承されるプロパティを設定できます。 XAML でインスタンス化でき、XAML でプロパティを設定できる 2 つの既存InputBindingの派生クラスは と MouseBindingですKeyBinding。
XAML 属性の使用方法
<KeyBindingGesture
="KeyGesture"/>
または
<MouseBindingGesture
="MouseGesture"/>
または
<inputBindingDerivedClass
Gesture
="InputGesture"/>
XAML プロパティ要素の使用
<inputBindingDerivedClass>
<inputBindingDerivedClass.Gesture>
<inputGestureImplementation/>
</inputBindingDerivedClass.Gesture>
</inputBindingDerivedClass>
XAML 値
inputBindingDerivedClass
や MouseBindingなどのKeyBindingオブジェクト要素構文InputBindingをサポートする の派生クラス。 「解説」を参照してください。
inputGestureImplementation
オブジェクト要素の InputGesture 構文をサポートする のカスタム派生クラス。
適用対象
こちらもご覧ください
.NET
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示