Export (0) Print
Expand All

InputBinding.CommandTarget Property

Gets or sets the target element of the command.

Namespace:  System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

'Declaration
Public Property CommandTarget As IInputElement
<inputBindingDerivedClass CommandTarget="bindingToTarget"/>

XAML Values

inputBindingDerivedClass

A derived class of InputBinding that supports object element syntax, such as KeyBinding or MouseBinding. See Remarks.

bindingToTarget

A string that uses a type of binding syntax that can return an object reference to an existing named element. See Remarks.

Property Value

Type: System.Windows.IInputElement
The target of the command. The default is Nothing.

Implements

ICommandSource.CommandTarget

In the Windows Presentation Foundation (WPF) commanding system, the CommandTarget property on an ICommandSource object is applicable only when the ICommand is a RoutedCommand. If the CommandTarget is set on an ICommandSource and the corresponding command is not a RoutedCommand, the command target is ignored.

When used with a RoutedCommand, the command target is the object on which the Executed and CanExecute events are raised. If the CommandTarget property is not set, the element with keyboard focus is used as the target.

The InputBinding class itself does not support XAML usage, because it does not expose a public default constructor (there is a default constructor, but it is protected). However, derived classes can expose a public constructor and therefore can set properties that are inherited from InputBinding with a XAML usage. Two existing InputBinding derived classes that can be instantiated in XAML and can set properties in XAML are KeyBinding and MouseBinding.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft