Updated: February 2009
Gets or sets the target element of the command.
Assembly: PresentationCore (in PresentationCore.dll)
'Declaration Public Property CommandTarget As IInputElement 'Usage Dim instance As InputBinding Dim value As IInputElement value = instance.CommandTarget instance.CommandTarget = value
Property ValueType: System.Windows.IInputElement
The target of the command. The default is Nothing.
In the Windows Presentation Foundation (WPF) commanding system, the property on an ICommandSource object is applicable only when the ICommand is a RoutedCommand. If the 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 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 thus 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.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.