InputBindingCollection InputBindingCollection InputBindingCollection InputBindingCollection Class

Definição

Representa uma coleção ordenada de objetos de InputBinding.Represents an ordered collection of InputBinding objects.

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

Exemplos

O exemplo a seguir cria KeyGesture um e o associa a KeyBindingum.The following example creates a KeyGesture and associates it with a KeyBinding. O KeyBinding é adicionado InputBindingCollection ao em um Window.The KeyBinding is added to the InputBindingCollection on a Window.

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

Comentários

Todos os objetos que derivam de UIElement têm InputBindingsum InputBindingCollection nome.All objects that derive from UIElement have an InputBindingCollection named InputBindings. Todos os objetos que derivam de ContentElement têm InputBindingsum InputBindingCollection nome.All objects that derive from ContentElement have an InputBindingCollection named InputBindings.

No entanto, se essas coleções forem XAMLXAMLdefinidas em, os itens na coleção deverão ser InputBinding classes derivadas em vez de objetos InputBinding diretos.However, if these collections are set in XAMLXAML, then the items in the collection must be derived classes of InputBinding rather than direct InputBinding objects. Isso ocorre porque InputBinding o não oferece suporte a um construtor público padrão.This is because InputBinding does not support a default public constructor. Portanto, os itens em um InputBindingCollection que foram definidos em XAMLXAML normalmente serão uma InputBinding classe derivada que KeyBinding oferece suporte a um construtor público padrão, como ou MouseBinding.Therefore, the items in a InputBindingCollection that was set in XAMLXAML will typically be an InputBinding derived class that does support a default public constructor, such as KeyBinding or MouseBinding.

Construtores

InputBindingCollection() InputBindingCollection() InputBindingCollection() InputBindingCollection()

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

InputBindingCollection(IList) InputBindingCollection(IList) InputBindingCollection(IList) InputBindingCollection(IList)

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

Propriedades

Count Count Count Count

Obtém o número de itens InputBinding nesta coleção.Gets the number of InputBinding items in this collection.

IsFixedSize IsFixedSize IsFixedSize IsFixedSize

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

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

Obtém um valor que indica se este InputBindingCollection é somente leitura.Gets a value that indicates whether this InputBindingCollection is read-only.

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

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

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

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

SyncRoot SyncRoot SyncRoot SyncRoot

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

Métodos

Add(InputBinding) Add(InputBinding) Add(InputBinding) Add(InputBinding)

Adiciona o InputBinding especificado a este InputBindingCollection.Adds the specified InputBinding to this InputBindingCollection.

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

Adiciona os itens do ICollection especificado ao final desta InputBindingCollectionAdds the items of the specified ICollection to the end of this InputBindingCollection

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

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

Contains(InputBinding) Contains(InputBinding) Contains(InputBinding) Contains(InputBinding)

Determina se o InputBinding especificado está neste InputBindingCollectionDetermines whether the specified InputBinding is in this InputBindingCollection

CopyTo(InputBinding[], Int32) CopyTo(InputBinding[], Int32) CopyTo(InputBinding[], Int32) CopyTo(InputBinding[], Int32)

Copia todos os itens no InputBindingCollection para a matriz unidimensional especificada, iniciando no índice especificado da matriz de destino.Copies all of the items in the InputBindingCollection 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 InputBindingCollection.Gets an enumerator that iterates through this InputBindingCollection.

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(InputBinding) IndexOf(InputBinding) IndexOf(InputBinding) IndexOf(InputBinding)

Pesquisa pela primeira ocorrência do InputBinding especificado nesta InputBindingCollection.Searches for the first occurrence of the specified InputBinding in his InputBindingCollection.

Insert(Int32, InputBinding) Insert(Int32, InputBinding) Insert(Int32, InputBinding) Insert(Int32, InputBinding)

Insere o InputBinding especificado nesta InputBindingCollection no índice especificado.Inserts the specified InputBinding into this InputBindingCollection 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(InputBinding) Remove(InputBinding) Remove(InputBinding) Remove(InputBinding)

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

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

Remove o InputBinding especificado no índice especificado desta InputBindingCollection.Removes the specified InputBinding at the specified index of this InputBindingCollection.

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