CommandBindingCollection Třída

Definice

Představuje kolekci CommandBinding objektů.

public ref class CommandBindingCollection sealed : System::Collections::IList
public sealed class CommandBindingCollection : System.Collections.IList
type CommandBindingCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
type CommandBindingCollection = class
    interface ICollection
    interface IEnumerable
    interface IList
Public NotInheritable Class CommandBindingCollection
Implements IList
Dědičnost
CommandBindingCollection
Implementuje

Příklady

Následující příklad vytvoří CommandBinding a přidá jej do CommandBindingCollection souboru Window.

<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)

Poznámky

Všechny objekty, které jsou odvozeny od UIElement pojmenovaného CommandBindingCollection

CommandBindings.

Konstruktory

Name Description
CommandBindingCollection()

Inicializuje novou instanci CommandBindingCollection třídy.

CommandBindingCollection(IList)

Inicializuje novou instanci CommandBindingCollection třídy pomocí položek v zadané IList.

Vlastnosti

Name Description
Count

Získá počet CommandBinding položek v tomto CommandBindingCollection.

IsFixedSize

Získá hodnotu určující, zda má tato CommandBindingCollection hodnota pevnou velikost.

IsReadOnly

Získá hodnotu označující, zda je to CommandBindingCollection jen pro čtení.

IsSynchronized

Získá hodnotu označující, zda je přístup k tomuto CommandBindingCollection stavu synchronizován (thread-safe).

Item[Int32]

Získá nebo nastaví v zadaném indexu CommandBinding .

SyncRoot

Získá objekt, který lze použít k synchronizaci přístupu k CommandBindingCollection.

Metody

Name Description
Add(CommandBinding)

Přidá do tohoto CommandBindingparametru zadaný CommandBindingCollection parametr .

AddRange(ICollection)

Přidá položky zadané ICollection na konec tohoto CommandBindingCollectionparametru .

Clear()

Odebere všechny položky z tohoto objektu CommandBindingCollection.

Contains(CommandBinding)

Určuje, zda zadaný CommandBinding je v tomto CommandBindingCollection.

CopyTo(CommandBinding[], Int32)

Zkopíruje všechny položky v CommandBindingCollection zadaném jednorozměrném poli počínaje zadaným indexem cílového pole.

Equals(Object)

Určuje, zda je zadaný objekt roven aktuálnímu objektu.

(Zděděno od Object)
GetEnumerator()

Získá enumerátor, který iteruje tímto CommandBindingCollection.

GetHashCode()

Slouží jako výchozí funkce hash.

(Zděděno od Object)
GetType()

Získá Type aktuální instance.

(Zděděno od Object)
IndexOf(CommandBinding)

Vyhledá první výskyt zadaného CommandBinding v tomto CommandBindingCollectionsouboru .

Insert(Int32, CommandBinding)

Vloží zadaný do CommandBinding tohoto CommandBindingCollection objektu v zadaném indexu.

MemberwiseClone()

Vytvoří mělkou kopii aktuálního Object.

(Zděděno od Object)
Remove(CommandBinding)

Odebere první výskyt zadaného CommandBinding z tohoto CommandBindingCollectionobjektu .

RemoveAt(Int32)

Odebere zadanou CommandBinding v zadaném indexu tohoto CommandBindingCollectionparametru .

ToString()

Vrátí řetězec, který představuje aktuální objekt.

(Zděděno od Object)

Explicitní implementace rozhraní

Name Description
ICollection.CopyTo(Array, Int32)

Popis tohoto člena naleznete v tématu CopyTo(Array, Int32).

IList.Add(Object)

Popis tohoto člena naleznete v tématu Add(Object).

IList.Contains(Object)

Popis tohoto člena naleznete v tématu Contains(Object).

IList.IndexOf(Object)

Popis tohoto člena naleznete v tématu IndexOf(Object).

IList.Insert(Int32, Object)

Popis tohoto člena naleznete v tématu Insert(Int32, Object).

IList.Item[Int32]

Popis tohoto člena naleznete v tématu Item[Int32].

IList.Remove(Object)

Popis tohoto člena naleznete v tématu Remove(Object).

Metody rozšíření

Name Description
AsParallel(IEnumerable)

Umožňuje paralelizaci dotazu.

AsQueryable(IEnumerable)

Převede IEnumerable na IQueryable.

Cast<TResult>(IEnumerable)

Přetypuje prvky IEnumerable na zadaný typ.

OfType<TResult>(IEnumerable)

Filtruje prvky IEnumerable na základě zadaného typu.

Platí pro

Viz také