CommandBindingCollection クラス

定義

CommandBinding オブジェクトのコレクションを表します。

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

次の例では、CommandBindingを作成し、CommandBindingCollectionWindowに追加します。

<Window x:Class="SDKSamples.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:custom="clr-namespace:SDKSamples"
    Height="600" Width="800"
    >
  <Window.CommandBindings>
    <CommandBinding Command="{x:Static custom:Window1.CustomRoutedCommand}"
                    Executed="ExecutedCustomCommand"
                    CanExecute="CanExecuteCustomCommand" />
  </Window.CommandBindings>
CommandBinding customCommandBinding = new CommandBinding(
    CustomRoutedCommand, ExecutedCustomCommand, CanExecuteCustomCommand);

// attach CommandBinding to root window
this.CommandBindings.Add(customCommandBinding);
Dim customCommandBinding As New CommandBinding(CustomRoutedCommand, AddressOf ExecutedCustomCommand, AddressOf CanExecuteCustomCommand)

' attach CommandBinding to root window
Me.CommandBindings.Add(customCommandBinding)

注釈

UIElementから派生するすべてのオブジェクトには、名前付きのCommandBindingCollectionがあります

CommandBindings

コンストラクター

名前 説明
CommandBindingCollection()

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

CommandBindingCollection(IList)

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

プロパティ

名前 説明
Count

このCommandBindingCollection内のCommandBinding項目の数を取得します。

IsFixedSize

この CommandBindingCollection のサイズが固定されているかどうかを示す値を取得します。

IsReadOnly

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

IsSynchronized

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

Item[Int32]

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

SyncRoot

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

メソッド

名前 説明
Add(CommandBinding)

指定した CommandBinding をこの CommandBindingCollectionに追加します。

AddRange(ICollection)

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

Clear()

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

Contains(CommandBinding)

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

CopyTo(CommandBinding[], Int32)

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

Equals(Object)

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

(継承元 Object)
GetEnumerator()

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

GetHashCode()

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

(継承元 Object)
GetType()

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

(継承元 Object)
IndexOf(CommandBinding)

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

Insert(Int32, CommandBinding)

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

MemberwiseClone()

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

(継承元 Object)
Remove(CommandBinding)

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

RemoveAt(Int32)

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

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 の要素をフィルター処理します。

適用対象

こちらもご覧ください