InputBinding.CommandTarget Property

Gets or sets the target element of the command.

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

public IInputElement CommandTarget { get; set; }
/** @property */
public final IInputElement get_CommandTarget ()

/** @property */
public void set_CommandTarget (IInputElement value)

public final function get CommandTarget () : IInputElement

public function set CommandTarget (value : IInputElement)

You cannot use this property in XAML.

Property Value

The target of the command. The default value is a null reference (Nothing in Visual Basic).

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 will be used as the target.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0