CommandBindingCollection Klasa
Definicja
Reprezentuje kolekcję CommandBinding obiektów.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 ICollection
interface IEnumerable
interface IList
type CommandBindingCollection = class
interface IList
interface ICollection
interface IEnumerable
Public NotInheritable Class CommandBindingCollection
Implements IList
- Dziedziczenie
-
CommandBindingCollection
- Implementuje
Przykłady
Poniższy przykład tworzy CommandBinding i dodaje go do CommandBindingCollection 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)
Uwagi
Wszystkie obiekty, które pochodzą z UIElement mają CommandBindingCollection nazwaneAll objects which derive from UIElement have a CommandBindingCollection named
CommandBindings.CommandBindings.
Konstruktory
CommandBindingCollection() |
Inicjuje nowe wystąpienie klasy CommandBindingCollection.Initializes a new instance of the CommandBindingCollection class. |
CommandBindingCollection(IList) |
Inicjuje nowe wystąpienie CommandBindingCollection klasy za pomocą elementów w określonym IList .Initializes a new instance of the CommandBindingCollection class using the items in the specified IList. |
Właściwości
Count |
Pobiera liczbę CommandBinding elementów w tym elemencie CommandBindingCollection .Gets the number of CommandBinding items in this CommandBindingCollection. |
IsFixedSize |
Pobiera wartość wskazującą, czy CommandBindingCollection ma ona stały rozmiar.Gets a value indicating whether this CommandBindingCollection has a fixed size. |
IsReadOnly |
Pobiera wartość wskazującą, czy CommandBindingCollection jest to tylko do odczytu.Gets a value indicating whether this CommandBindingCollection is read-only. |
IsSynchronized |
Pobiera wartość wskazującą, czy dostęp do tego elementu CommandBindingCollection jest synchronizowany (bezpieczny wątkowo).Gets a value indicating whether access to this CommandBindingCollection is synchronized (thread-safe). |
Item[Int32] |
Pobiera lub ustawia wartość CommandBinding o określonym indeksie.Gets or sets the CommandBinding at the specified index. |
SyncRoot |
Pobiera obiekt, który może służyć do synchronizowania dostępu do CommandBindingCollection .Gets an object that can be used to synchronize access to the CommandBindingCollection. |
Metody
Add(CommandBinding) |
Dodaje określony CommandBinding do tego CommandBindingCollection .Adds the specified CommandBinding to this CommandBindingCollection. |
AddRange(ICollection) |
Dodaje elementy określonego ICollection na końcu CommandBindingCollection .Adds the items of the specified ICollection to the end of this CommandBindingCollection. |
Clear() |
Usuwa wszystkie elementy z tego elementu CommandBindingCollection .Removes all items from this CommandBindingCollection. |
Contains(CommandBinding) |
Określa, czy określono CommandBinding w tym elemencie CommandBindingCollection .Determines whether the specified CommandBinding is in this CommandBindingCollection. |
CopyTo(CommandBinding[], Int32) |
Kopiuje wszystkie elementy w CommandBindingCollection do określonej jednowymiarowej tablicy, rozpoczynając od określonego indeksu tablicy docelowej.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) |
Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.Determines whether the specified object is equal to the current object. (Odziedziczone po Object) |
GetEnumerator() |
Pobiera moduł wyliczający, który wykonuje iterację w tym celu CommandBindingCollection .Gets an enumerator that iterates through this CommandBindingCollection. |
GetHashCode() |
Służy jako domyślna funkcja skrótu.Serves as the default hash function. (Odziedziczone po Object) |
GetType() |
Pobiera Type bieżące wystąpienie.Gets the Type of the current instance. (Odziedziczone po Object) |
IndexOf(CommandBinding) |
Wyszukuje pierwsze wystąpienie określonego CommandBinding w tym elemencie CommandBindingCollection .Searches for the first occurrence of the specified CommandBinding in this CommandBindingCollection. |
Insert(Int32, CommandBinding) |
Wstawia określony CommandBinding do tego CommandBindingCollection indeksu o określonym indeksie.Inserts the specified CommandBinding into this CommandBindingCollection at the specified index. |
MemberwiseClone() |
Tworzy skróconą kopię bieżącego elementu Object .Creates a shallow copy of the current Object. (Odziedziczone po Object) |
Remove(CommandBinding) |
Usuwa pierwsze wystąpienie określonego CommandBinding z tego elementu CommandBindingCollection .Removes the first occurrence of the specified CommandBinding from this CommandBindingCollection. |
RemoveAt(Int32) |
Usuwa określony CommandBinding indeks CommandBindingCollection .Removes the specified CommandBinding at the specified index of this CommandBindingCollection. |
ToString() |
Zwraca ciąg reprezentujący bieżący obiekt.Returns a string that represents the current object. (Odziedziczone po Object) |
Jawne implementacje interfejsu
ICollection.CopyTo(Array, Int32) |
Aby uzyskać opis tego elementu członkowskiego, zobacz CopyTo(Array, Int32) .For a description of this member, see CopyTo(Array, Int32). |
IList.Add(Object) |
Aby uzyskać opis tego elementu członkowskiego, zobacz Add(Object) .For a description of this member, see Add(Object). |
IList.Contains(Object) |
Aby uzyskać opis tego elementu członkowskiego, zobacz Contains(Object) .For a description of this member, see Contains(Object). |
IList.IndexOf(Object) |
Aby uzyskać opis tego elementu członkowskiego, zobacz IndexOf(Object) .For a description of this member, see IndexOf(Object). |
IList.Insert(Int32, Object) |
Aby uzyskać opis tego elementu członkowskiego, zobacz Insert(Int32, Object) .For a description of this member, see Insert(Int32, Object). |
IList.Item[Int32] |
Aby uzyskać opis tego elementu członkowskiego, zobacz Item[Int32] .For a description of this member, see Item[Int32]. |
IList.Remove(Object) |
Aby uzyskać opis tego elementu członkowskiego, zobacz Remove(Object) .For a description of this member, see Remove(Object). |
Metody rozszerzania
Cast<TResult>(IEnumerable) |
Rzutuje elementy elementu IEnumerable do określonego typu.Casts the elements of an IEnumerable to the specified type. |
OfType<TResult>(IEnumerable) |
Filtruje elementy IEnumerable w oparciu o określony typ.Filters the elements of an IEnumerable based on a specified type. |
AsParallel(IEnumerable) |
Włącza przetwarzanie równoległe zapytania.Enables parallelization of a query. |
AsQueryable(IEnumerable) |
Konwertuje IEnumerable do IQueryable .Converts an IEnumerable to an IQueryable. |