CommandTriggerActionBase

Name Value
Assembly Catel.MVVM
Namespace Catel.Windows.Interactivity
Available on .NET Framework 4.5, .NET Framework 4.6
public abstract class CommandTriggerActionBase<T> : TriggerActionBase<T, T> where T : FrameworkElement 

Base types TriggerActionBase

Trigger base class that handles a safe unsubscribe and clean up because the default Trigger class does not always call OnDetaching. This class extends the Missing: <see cref=“T:Catel.Windows.Interactivity.TriggerActionBase`1” /> class by adding supports for commands.

Type Parameters

T The this behavior should attach to.

Fields

CommandParameterProperty

The property definition for the CommandParameter dependency property.

CommandProperty

Using a DependencyProperty as the backing store for Command. This enables animation, styling, binding, etc…

ModifiersProperty

Using a DependencyProperty as the backing store for Modifiers. This enables animation, styling, binding, etc…

Properties

Command

Gets or sets the command to execute when the key is pressed.

CommandParameter

Gets or sets the command parameter, which will override the parameter defined in the direct command binding.

Modifiers

Gets or sets the modifiers to check for.

Methods

CanExecuteCommand()

Determines whether the command can be invoked. It does this by checking both the Modifiers and the command itself.

Returns

true if the command can be invoked; otherwise,false.

CanExecuteCommand(object parameter)

Determines whether the command can be invoked. It does this by checking both the Modifiers and the command itself. If the CommandParameter should be used, use the CanExecuteCommand instead.

Returns

true if the command can be invoked; otherwise,false.

ExecuteCommand()

Invokes the command with the specified parameter.

ExecuteCommand(object parameter)

Invokes the command with the overriden parameter. If the CommandParameter should be used, use the ExecuteCommand instead.

Parameters

Name Description
parameter The parameter that will override the CommandParameter.

OnAssociatedObjectLoaded()

Called when the associated object is loaded.

OnAssociatedObjectUnloaded()

Called when the associated object is unloaded.

OnCommandCanExecuteChanged()

Called when the state has changed.

OnCommandChanged()

Invoked when the Command property has changed.

OnCommandParameterChanged()

Invoked when the CommandParameter property has changed.


Have a question about Catel? Use StackOverflow with the Catel tag!


Discussion