CommandBindingCollection CommandBindingCollection CommandBindingCollection CommandBindingCollection Class

Definição

Representa uma coleção de objetos CommandBinding .Represents a collection of CommandBinding objects.

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
Herança
CommandBindingCollectionCommandBindingCollectionCommandBindingCollectionCommandBindingCollection
Implementações

Exemplos

O exemplo a seguir cria CommandBinding um e o CommandBindingCollection adiciona ao de um Window.The following example creates a CommandBinding and adds it to the CommandBindingCollection of a 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)

Comentários

Todos os objetos que derivam UIElement de CommandBindingCollection têm um nomeAll objects which derive from UIElement have a CommandBindingCollection named

CommandBindings.CommandBindings.

Construtores

CommandBindingCollection() CommandBindingCollection() CommandBindingCollection() CommandBindingCollection()

Inicializa uma nova instância da classe CommandBindingCollection.Initializes a new instance of the CommandBindingCollection class.

CommandBindingCollection(IList) CommandBindingCollection(IList) CommandBindingCollection(IList) CommandBindingCollection(IList)

Inicializa uma nova instância da classe CommandBindingCollection usando os itens no IList especificado.Initializes a new instance of the CommandBindingCollection class using the items in the specified IList.

Propriedades

Count Count Count Count

Obtém o número de itens CommandBinding nesta CommandBindingCollection.Gets the number of CommandBinding items in this CommandBindingCollection.

IsFixedSize IsFixedSize IsFixedSize IsFixedSize

Obtém um valor que indica se este CommandBindingCollection tem um tamanho fixo.Gets a value indicating whether this CommandBindingCollection has a fixed size.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

Obtém um valor que indica se o CommandBindingCollection é somente leitura.Gets a value indicating whether this CommandBindingCollection is read-only.

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

Obtém um valor que indica se o acesso essa CommandBindingCollection é sincronizado (thread-safe).Gets a value indicating whether access to this CommandBindingCollection is synchronized (thread-safe).

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

Obtém ou define o CommandBinding no índice especificado.Gets or sets the CommandBinding at the specified index.

SyncRoot SyncRoot SyncRoot SyncRoot

Obtém um objeto que pode ser usado para sincronizar o acesso ao CommandBindingCollection.Gets an object that can be used to synchronize access to the CommandBindingCollection.

Métodos

Add(CommandBinding) Add(CommandBinding) Add(CommandBinding) Add(CommandBinding)

Adiciona o CommandBinding especificado a este CommandBindingCollection.Adds the specified CommandBinding to this CommandBindingCollection.

AddRange(ICollection) AddRange(ICollection) AddRange(ICollection) AddRange(ICollection)

Adiciona os itens do ICollection especificado ao final desta CommandBindingCollection.Adds the items of the specified ICollection to the end of this CommandBindingCollection.

Clear() Clear() Clear() Clear()

Remove todos os itens desta CommandBindingCollection.Removes all items from this CommandBindingCollection.

Contains(CommandBinding) Contains(CommandBinding) Contains(CommandBinding) Contains(CommandBinding)

Determina se o CommandBinding especificado está neste CommandBindingCollection.Determines whether the specified CommandBinding is in this CommandBindingCollection.

CopyTo(CommandBinding[], Int32) CopyTo(CommandBinding[], Int32) CopyTo(CommandBinding[], Int32) CopyTo(CommandBinding[], Int32)

Copia todos os itens no CommandBindingCollection para a matriz unidimensional especificada, iniciando no índice especificado da matriz de destino.Copies all of the items in the CommandBindingCollection to the specified one-dimensional array, starting at the specified index of the target array.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Obtém um enumerador que itera por esta CommandBindingCollection.Gets an enumerator that iterates through this CommandBindingCollection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serve como a função de hash padrão.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Obtém o Type da instância atual.Gets the Type of the current instance.

(Inherited from Object)
IndexOf(CommandBinding) IndexOf(CommandBinding) IndexOf(CommandBinding) IndexOf(CommandBinding)

Pesquisa pela primeira ocorrência do CommandBinding especificado nesta CommandBindingCollection.Searches for the first occurrence of the specified CommandBinding in this CommandBindingCollection.

Insert(Int32, CommandBinding) Insert(Int32, CommandBinding) Insert(Int32, CommandBinding) Insert(Int32, CommandBinding)

Insere o CommandBinding especificado nesta CommandBindingCollection no índice especificado.Inserts the specified CommandBinding into this CommandBindingCollection at the specified index.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object.

(Inherited from Object)
Remove(CommandBinding) Remove(CommandBinding) Remove(CommandBinding) Remove(CommandBinding)

Remove a primeira ocorrência do CommandBinding especificado dessa CommandBindingCollection.Removes the first occurrence of the specified CommandBinding from this CommandBindingCollection.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

Remove o CommandBinding especificado no índice especificado desta CommandBindingCollection.Removes the specified CommandBinding at the specified index of this CommandBindingCollection.

ToString() ToString() ToString() ToString()

Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object.

(Inherited from Object)

Implantações explícitas de interface

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

Para obter uma descrição desse membro, consulte CopyTo(Array, Int32).For a description of this member, see CopyTo(Array, Int32).

IList.Add(Object) IList.Add(Object) IList.Add(Object) IList.Add(Object)

Para obter uma descrição desse membro, consulte Add(Object).For a description of this member, see Add(Object).

IList.Contains(Object) IList.Contains(Object) IList.Contains(Object) IList.Contains(Object)

Para obter uma descrição desse membro, consulte Contains(Object).For a description of this member, see Contains(Object).

IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object)

Para obter uma descrição desse membro, consulte IndexOf(Object).For a description of this member, see IndexOf(Object).

IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object)

Para obter uma descrição desse membro, consulte Insert(Int32, Object).For a description of this member, see Insert(Int32, Object).

IList.Item[Int32] IList.Item[Int32] IList.Item[Int32] IList.Item[Int32]

Para obter uma descrição desse membro, consulte Item[Int32].For a description of this member, see Item[Int32].

IList.Remove(Object) IList.Remove(Object) IList.Remove(Object) IList.Remove(Object)

Para obter uma descrição desse membro, consulte Remove(Object).For a description of this member, see Remove(Object).

Métodos de Extensão

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

Converte os elementos de um IEnumerable para o tipo especificado.Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

Filtra os elementos de um IEnumerable com base em um tipo especificado.Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

Habilita a paralelização de uma consulta.Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

Converte um IEnumerable em um IQueryable.Converts an IEnumerable to an IQueryable.

Aplica-se a

Veja também