InputBinding.CommandParameter Property
Gets or sets the command-specific data for a particular 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
abstract CommandParameter : Object with get, set override CommandParameter : Object with get, set
<inputBindingDerivedClass> <inputBindingDerivedClass.CommandParameter> <commandParameterObject/> </inputBindingDerivedClass.CommandParameter> </inputBindingDerivedClass>
<inputBindingDerivedClass CommandParameter="commandParameterString"/>
XAML Values
Property Value
Type: System.ObjectThe command-specific data. The default is a null reference (Nothing in Visual Basic).
Implements
ICommandSource.CommandParameterThe CommandParameter property is used to pass specific information to the command when it is executed. The type of the data is defined by the command. Many commands do not expect command parameters; for these commands, any command parameters passed will be ignored.
If the command that an input binding is associated with is a RoutedCommand, the CommandParameter of the input binding is passed to the RoutedCommand handlers through the ExecutedRoutedEventArgs and the CanExecuteRoutedEventArgs event data when the command is processed.
The data type and purpose of the command parameter are defined differently for each command and can be a null reference (Nothing in Visual Basic). You can bind the Command, CommandParameter, and CommandTarget properties to an ICommand that is defined on an object. This enables you to define a custom command and associate it with user input. For more information, see the second example in InputBinding.
The InputBinding class does not support XAML usage because it does not expose a public default constructor (it has 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 XAML usage. Two existing InputBinding derived classes that can be instantiated in XAML and can set properties in XAML are KeyBinding and MouseBinding.
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.