InputBindingCollection Class
TOC
Collapse the table of content
Expand the table of content

InputBindingCollection Class

 

Represents an ordered collection of InputBinding objects.

Namespace:   System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)

System.Object
  System.Windows.Input.InputBindingCollection

public sealed class InputBindingCollection : IList, ICollection, 
	IEnumerable

NameDescription
System_CAPS_pubmethodInputBindingCollection()

Initializes a new instance of the InputBindingCollection class.

System_CAPS_pubmethodInputBindingCollection(IList)

Initializes a new instance of the InputBindingCollection class using the items in the specified IList.

NameDescription
System_CAPS_pubpropertyCount

Gets the number of InputBinding items in this collection.

System_CAPS_pubpropertyIsFixedSize

Gets a value that indicates whether this InputBindingCollection has a fixed size.

System_CAPS_pubpropertyIsReadOnly

Gets a value that indicates whether this InputBindingCollection is read-only.

System_CAPS_pubpropertyIsSynchronized

Gets a value indicating whether access to this InputBindingCollection is synchronized (thread-safe).

System_CAPS_pubpropertyItem[Int32]

Gets or sets the InputBinding at the specified index.

System_CAPS_pubpropertySyncRoot

Gets an object that can be used to synchronize access to the InputBindingCollection.

NameDescription
System_CAPS_pubmethodAdd(InputBinding)

Adds the specified InputBinding to this InputBindingCollection.

System_CAPS_pubmethodAddRange(ICollection)

Adds the items of the specified ICollection to the end of this InputBindingCollection

System_CAPS_pubmethodClear()

Removes all items from this InputBindingCollection.

System_CAPS_pubmethodContains(InputBinding)

Determines whether the specified InputBinding is in this InputBindingCollection

System_CAPS_pubmethodCopyTo(InputBinding[], Int32)

Copies all of the items in the InputBindingCollection to the specified one-dimensional array, starting at the specified index of the target array.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetEnumerator()

Gets an enumerator that iterates through this InputBindingCollection.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodIndexOf(InputBinding)

Searches for the first occurrence of the specified InputBinding in his InputBindingCollection.

System_CAPS_pubmethodInsert(Int32, InputBinding)

Inserts the specified InputBinding into this InputBindingCollection at the specified index.

System_CAPS_pubmethodRemove(InputBinding)

Removes the first occurrence of the specified InputBinding from this InputBindingCollection.

System_CAPS_pubmethodRemoveAt(Int32)

Removes the specified InputBinding at the specified index of this InputBindingCollection.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodICollection.CopyTo(Array, Int32)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see ICollection.CopyTo.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Add(Object)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IList.Add.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Contains(Object)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IList.Contains.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.IndexOf(Object)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IList.IndexOf.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Insert(Int32, Object)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IList.Insert.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIList.Remove(Object)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IList.Remove.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIList.Item[Int32]

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IList.Item.

NameDescription
System_CAPS_pubmethodAsParallel()

Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)

System_CAPS_pubmethodAsQueryable()

Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.)

System_CAPS_pubmethodCast<TResult>()

Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.)

System_CAPS_pubmethodOfType<TResult>()

Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.)

All objects that derive from UIElement have an InputBindingCollection named InputBindings. All objects that derive from ContentElement have an InputBindingCollection named InputBindings.

However, if these collections are set in XAML, then the items in the collection must be derived classes of InputBinding rather than direct InputBinding objects. This is because InputBinding does not support a default public constructor. Therefore, the items in a InputBindingCollection that was set in XAML will typically be an InputBinding derived class that does support a default public constructor, such as KeyBinding or MouseBinding.

The following example creates a KeyGesture and associates it with a KeyBinding. 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);

.NET Framework
Available since 3.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft