CommandBindingCollection CommandBindingCollection CommandBindingCollection CommandBindingCollection Class

Definizione

Rappresenta una raccolta di oggetti 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
Ereditarietà
CommandBindingCollectionCommandBindingCollectionCommandBindingCollectionCommandBindingCollection
Implementazioni

Esempi

Nell'esempio seguente viene creato CommandBinding un oggetto e viene aggiunto CommandBindingCollection all'oggetto Windowdi un oggetto.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)

Commenti

Tutti gli oggetti che derivano UIElement da CommandBindingCollection hanno un oggetto denominatoAll objects which derive from UIElement have a CommandBindingCollection named

CommandBindings.CommandBindings.

Costruttori

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

Inizializza una nuova istanza della classe CommandBindingCollection.Initializes a new instance of the CommandBindingCollection class.

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

Inizializza una nuova istanza della classe CommandBindingCollection utilizzando gli elementi dell'oggetto IList specificato.Initializes a new instance of the CommandBindingCollection class using the items in the specified IList.

Proprietà

Count Count Count Count

Ottiene il numero di elementi di CommandBinding in questo oggetto CommandBindingCollection.Gets the number of CommandBinding items in this CommandBindingCollection.

IsFixedSize IsFixedSize IsFixedSize IsFixedSize

Ottiene un valore che indica se le dimensioni di CommandBindingCollection sono fisse.Gets a value indicating whether this CommandBindingCollection has a fixed size.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

Ottiene un valore che indica se CommandBindingCollection è in sola lettura.Gets a value indicating whether this CommandBindingCollection is read-only.

IsSynchronized IsSynchronized IsSynchronized IsSynchronized

Ottiene un valore che indica se l'accesso a CommandBindingCollection è sincronizzato, ovvero thread-safe.Gets a value indicating whether access to this CommandBindingCollection is synchronized (thread-safe).

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

Ottiene o imposta l'oggetto CommandBinding in corrispondenza dell'indice specificato.Gets or sets the CommandBinding at the specified index.

SyncRoot SyncRoot SyncRoot SyncRoot

Ottiene un oggetto che può essere usato per sincronizzare l'accesso a CommandBindingCollection.Gets an object that can be used to synchronize access to the CommandBindingCollection.

Metodi

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

Aggiunge l'entità CommandBinding specificata a questo oggetto CommandBindingCollection.Adds the specified CommandBinding to this CommandBindingCollection.

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

Aggiunge gli elementi dell'oggetto ICollection specificato alla fine di questo oggetto CommandBindingCollection.Adds the items of the specified ICollection to the end of this CommandBindingCollection.

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

Rimuove tutti gli elementi da CommandBindingCollection.Removes all items from this CommandBindingCollection.

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

Determina se l'oggetto CommandBinding specificato è contenuto in CommandBindingCollection.Determines whether the specified CommandBinding is in this CommandBindingCollection.

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

Copia tutti gli elementi dell'oggetto CommandBindingCollection nella matrice unidimensionale specificata, a partire dall'indice specificato della matrice di destinazione.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 l'oggetto specificato è uguale all'oggetto corrente.Determines whether the specified object is equal to the current object.

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

Ottiene un enumeratore che scorre questo oggetto CommandBindingCollection.Gets an enumerator that iterates through this CommandBindingCollection.

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

Funge da funzione hash predefinita.Serves as the default hash function.

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

Ottiene l'oggetto Type dell'istanza corrente.Gets the Type of the current instance.

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

Cerca la prima occorrenza dell'oggetto CommandBinding specificato in questo oggetto 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)

Inserisce l'oggetto CommandBinding specificato in questo oggetto CommandBindingCollection in corrispondenza dell'indice specificato.Inserts the specified CommandBinding into this CommandBindingCollection at the specified index.

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

Crea una copia superficiale dell'oggetto Object corrente.Creates a shallow copy of the current Object.

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

Rimuove la prima occorrenza dell'oggettoCommandBinding specificato da CommandBindingCollection.Removes the first occurrence of the specified CommandBinding from this CommandBindingCollection.

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

Rimuove l'oggetto CommandBinding specificato in corrispondenza dell'indice specificato di questo oggetto CommandBindingCollection.Removes the specified CommandBinding at the specified index of this CommandBindingCollection.

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

Restituisce una stringa che rappresenta l'oggetto corrente.Returns a string that represents the current object.

(Inherited from Object)

Implementazioni dell'interfaccia esplicita

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

Per una descrizione di questo membro, vedere 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)

Per una descrizione di questo membro, vedere Add(Object).For a description of this member, see Add(Object).

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

Per una descrizione di questo membro, vedere Contains(Object).For a description of this member, see Contains(Object).

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

Per una descrizione di questo membro, vedere 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)

Per una descrizione di questo membro, vedere 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]

Per una descrizione di questo membro, vedere Item[Int32].For a description of this member, see Item[Int32].

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

Per una descrizione di questo membro, vedere Remove(Object).For a description of this member, see Remove(Object).

Metodi di estensione

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

Esegue il cast degli elementi di un oggetto IEnumerable nel tipo specificato.Casts the elements of an IEnumerable to the specified type.

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

Filtra gli elementi di un oggetto IEnumerable in base a un tipo specificato.Filters the elements of an IEnumerable based on a specified type.

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

Consente la parallelizzazione di una query.Enables parallelization of a query.

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

Converte un oggetto IEnumerable in un oggetto IQueryable.Converts an IEnumerable to an IQueryable.

Si applica a

Vedi anche