Export (0) Print
Expand All

ICommandSource.CommandTarget Property

The object that the command is being executed on.

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

IInputElement CommandTarget { get; }

Property Value

Type: System.Windows.IInputElement
The object that the command is being executed on.

In the Windows Presentation Foundation (WPF) commanding system, the CommandTarget property on a ICommandSource is only applicable when the ICommand is a RoutedCommand. If the CommandTarget is set on a 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.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft