InputBindingCollection クラス

定義

InputBinding オブジェクトの順序付けられたコレクションを表します。

public ref class InputBindingCollection sealed : System::Collections::IList
public sealed class InputBindingCollection : System.Collections.IList
type InputBindingCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
Public NotInheritable Class InputBindingCollection
Implements IList
継承
InputBindingCollection
実装

次の例では、 KeyGesture を作成し、 KeyBindingに関連付けます。 KeyBindingは、InputBindingCollectionWindowに追加されます。

<Window.InputBindings>
  <KeyBinding Key="B"
              Modifiers="Control" 
              Command="ApplicationCommands.Open" />
</Window.InputBindings>
KeyGesture OpenKeyGesture = new KeyGesture(
    Key.B,
    ModifierKeys.Control);

KeyBinding OpenCmdKeybinding = new KeyBinding(
    ApplicationCommands.Open,
    OpenKeyGesture);

this.InputBindings.Add(OpenCmdKeybinding);
Dim OpenKeyGesture As New KeyGesture(Key.B, ModifierKeys.Control)

Dim OpenCmdKeybinding As New KeyBinding(ApplicationCommands.Open, OpenKeyGesture)

Me.InputBindings.Add(OpenCmdKeybinding)

注釈

UIElementから派生するすべてのオブジェクトには、InputBindingsという名前のInputBindingCollectionがあります。 ContentElementから派生するすべてのオブジェクトには、InputBindingsという名前のInputBindingCollectionがあります。

ただし、これらのコレクションが XAML で設定されている場合、コレクション内の項目は、ダイレクト InputBinding オブジェクトではなく、InputBindingの派生クラスである必要があります。 これは、 InputBinding が既定のパブリック コンストラクターをサポートしていないためです。 そのため、XAML で設定されたInputBindingCollection内の項目は、通常、KeyBindingMouseBindingなどの既定のパブリック コンストラクターをサポートするInputBinding派生クラスになります。

コンストラクター

名前 説明
InputBindingCollection()

InputBindingCollection クラスの新しいインスタンスを初期化します。

InputBindingCollection(IList)

指定したInputBindingCollection内の項目を使用して、IList クラスの新しいインスタンスを初期化します。

プロパティ

名前 説明
Count

このコレクション内の InputBinding 項目の数を取得します。

IsFixedSize

この InputBindingCollection に固定サイズがあるかどうかを示す値を取得します。

IsReadOnly

この InputBindingCollection が読み取り専用かどうかを示す値を取得します。

IsSynchronized

この InputBindingCollection へのアクセスが同期されているかどうかを示す値を取得します (スレッド セーフ)。

Item[Int32]

指定したインデックス位置にある InputBinding を取得または設定します。

SyncRoot

InputBindingCollectionへのアクセスを同期するために使用できるオブジェクトを取得します。

メソッド

名前 説明
Add(InputBinding)

指定した InputBinding をこの InputBindingCollectionに追加します。

AddRange(ICollection)

指定した ICollection の項目をこの InputBindingCollectionの末尾に追加します。

Clear()

この InputBindingCollectionからすべての項目を削除します。

Contains(InputBinding)

指定した InputBinding がこの InputBindingCollection内にあるかどうかを判断します。

CopyTo(InputBinding[], Int32)

ターゲット配列の指定したインデックスから始まる、指定した 1 次元配列に、 InputBindingCollection 内のすべての項目をコピーします。

Equals(Object)

指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetEnumerator()

この InputBindingCollectionを反復処理する列挙子を取得します。

GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IndexOf(InputBinding)

このInputBindingCollectionで、指定したInputBindingの最初の出現箇所を検索します。

Insert(Int32, InputBinding)

指定した InputBinding を、指定したインデックス位置にあるこの InputBindingCollection に挿入します。

MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
Remove(InputBinding)

指定した InputBinding の最初の出現箇所をこの InputBindingCollectionから削除します。

RemoveAt(Int32)

このInputBindingCollectionの指定したインデックス位置にある指定したInputBindingを削除します。

ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

明示的なインターフェイスの実装

名前 説明
ICollection.CopyTo(Array, Int32)

このメンバーの説明については、 CopyTo(Array, Int32)を参照してください。

IList.Add(Object)

このメンバーの説明については、 Add(Object)を参照してください。

IList.Contains(Object)

このメンバーの説明については、 Contains(Object)を参照してください。

IList.IndexOf(Object)

このメンバーの説明については、 IndexOf(Object)を参照してください。

IList.Insert(Int32, Object)

このメンバーの説明については、 Insert(Int32, Object)を参照してください。

IList.Item[Int32]

このメンバーの説明については、 Item[Int32]を参照してください。

IList.Remove(Object)

このメンバーの説明については、 Remove(Object)を参照してください。

拡張メソッド

名前 説明
AsParallel(IEnumerable)

クエリの並列化を有効にします。

AsQueryable(IEnumerable)

IEnumerableIQueryableに変換します。

Cast<TResult>(IEnumerable)

IEnumerable の要素を指定した型にキャストします。

OfType<TResult>(IEnumerable)

指定した型に基づいて、IEnumerable の要素をフィルター処理します。

適用対象

こちらもご覧ください