Class InvokeCommandAction
Executes a specified ICommand when invoked.
Inheritance
Implements
Inherited Members
Namespace: System.Windows.Interactivity
Assembly: OpenSilver.Interactivity.dll
Syntax
public sealed class InvokeCommandAction : TriggerAction<DependencyObject>, IDependencyObject, IAttachedObject
Fields
| Improve this Doc View SourceCommandParameterProperty
Declaration
public static readonly DependencyProperty CommandParameterProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
CommandProperty
Declaration
public static readonly DependencyProperty CommandProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
EventArgsConverterParameterProperty
Declaration
public static readonly DependencyProperty EventArgsConverterParameterProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
EventArgsConverterProperty
Declaration
public static readonly DependencyProperty EventArgsConverterProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
EventArgsParameterPathProperty
Declaration
public static readonly DependencyProperty EventArgsParameterPathProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceCommand
Gets or sets the command this action should invoke. This is a dependency property.
Declaration
public ICommand Command { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Input.ICommand | The command to execute. |
Remarks
This property will take precedence over the CommandName property if both are set.
CommandName
Gets or sets the name of the command this action should invoke.
Declaration
public string CommandName { get; set; }
Property Value
Type | Description |
---|---|
System.String | The name of the command this action should invoke. |
Remarks
This property will be superseded by the Command property if both are set.
CommandParameter
Gets or sets the command parameter. This is a dependency property.
Declaration
public object CommandParameter { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The command parameter. |
Remarks
This is the value passed to ICommand.CanExecute and ICommand.Execute.
EventArgsConverter
Gets or sets the IValueConverter that is used to convert the EventArgs passed to the Command as a parameter.
Declaration
public IValueConverter EventArgsConverter { get; set; }
Property Value
Type | Description |
---|---|
IValueConverter |
Remarks
If the Command or EventArgsParameterPath properties are set, this property is ignored.
EventArgsConverterParameter
Gets or sets the parameter that is passed to the EventArgsConverter.
Declaration
public object EventArgsConverterParameter { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
EventArgsParameterPath
Gets or sets the parameter path used to extract a value from an System.EventArgs property to pass to the Command as a parameter.
Declaration
public string EventArgsParameterPath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
If the Command propert is set, this property is ignored.
PassEventArgsToCommand
Specifies whether the EventArgs of the event that triggered this action should be passed to the Command as a parameter.
Declaration
public bool PassEventArgsToCommand { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
If the Command, EventArgsParameterPath, or EventArgsConverter properties are set, this property is ignored.
Methods
| Improve this Doc View SourceInvoke(Object)
Invokes the action.
Declaration
protected override void Invoke(object parameter)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parameter | The parameter to the action. If the action does not require a parameter, the parameter may be set to a null reference. |