Partager via


DelegateCommand Constructors

Definition

Overloads

DelegateCommand(Action)

Initializes a new instance of the DelegateCommand class. Using this constructor to initialize the DelegateCommand results in a command that can always execute.

DelegateCommand(Action<Object>)

Initializes a new instance of the DelegateCommand class. Using this constructor to initialize the DelegateCommand results in a command that can always execute.

DelegateCommand(Action, JoinableTaskFactory)

Initializes a new instance of the DelegateCommand class. Using this constructor to initialize the DelegateCommand results in a command that can always execute.

DelegateCommand(Action, Func<Boolean>)

Initializes a new instance of the DelegateCommand class.

DelegateCommand(Action<Object>, JoinableTaskFactory)

Initializes a new instance of the DelegateCommand class. Using this constructor to initialize the DelegateCommand results in a command that can always execute.

DelegateCommand(Action<Object>, Predicate<Object>)

Initializes a new instance of the DelegateCommand class.

DelegateCommand(Action, Func<Boolean>, JoinableTaskFactory)

Initializes a new instance of the DelegateCommand class.

DelegateCommand(Action<Object>, Predicate<Object>, JoinableTaskFactory)

Initializes a new instance of the DelegateCommand class.

DelegateCommand(Action)

Initializes a new instance of the DelegateCommand class. Using this constructor to initialize the DelegateCommand results in a command that can always execute.

public:
 DelegateCommand(Action ^ execute);
public DelegateCommand (Action execute);
new Microsoft.VisualStudio.PlatformUI.DelegateCommand : Action -> Microsoft.VisualStudio.PlatformUI.DelegateCommand
Public Sub New (execute As Action)

Parameters

execute
Action

The action to run when the command is executed.

Applies to

DelegateCommand(Action<Object>)

Initializes a new instance of the DelegateCommand class. Using this constructor to initialize the DelegateCommand results in a command that can always execute.

public:
 DelegateCommand(Action<System::Object ^> ^ execute);
public DelegateCommand (Action<object> execute);
new Microsoft.VisualStudio.PlatformUI.DelegateCommand : Action<obj> -> Microsoft.VisualStudio.PlatformUI.DelegateCommand
Public Sub New (execute As Action(Of Object))

Parameters

execute
Action<Object>

The action to run when the command is executed.

Applies to

DelegateCommand(Action, JoinableTaskFactory)

Initializes a new instance of the DelegateCommand class. Using this constructor to initialize the DelegateCommand results in a command that can always execute.

public DelegateCommand (Action execute, Microsoft.VisualStudio.Threading.JoinableTaskFactory jtf);
new Microsoft.VisualStudio.PlatformUI.DelegateCommand : Action * Microsoft.VisualStudio.Threading.JoinableTaskFactory -> Microsoft.VisualStudio.PlatformUI.DelegateCommand
Public Sub New (execute As Action, jtf As JoinableTaskFactory)

Parameters

execute
Action

The action to run when the command is executed.

jtf
JoinableTaskFactory

The task factory for the command. If this is non-null, the command will switch to the main thread before raising the CanExecuteChanged event.

Applies to

DelegateCommand(Action, Func<Boolean>)

Initializes a new instance of the DelegateCommand class.

public:
 DelegateCommand(Action ^ execute, Func<bool> ^ canExecute);
public DelegateCommand (Action execute, Func<bool> canExecute);
new Microsoft.VisualStudio.PlatformUI.DelegateCommand : Action * Func<bool> -> Microsoft.VisualStudio.PlatformUI.DelegateCommand
Public Sub New (execute As Action, canExecute As Func(Of Boolean))

Parameters

execute
Action

The action to run when the command is executed.

canExecute
Func<Boolean>

The function to evaluate whether this command is executable. If this parameter is null, the command is always executable.

Applies to

DelegateCommand(Action<Object>, JoinableTaskFactory)

Initializes a new instance of the DelegateCommand class. Using this constructor to initialize the DelegateCommand results in a command that can always execute.

public DelegateCommand (Action<object> execute, Microsoft.VisualStudio.Threading.JoinableTaskFactory jtf);
new Microsoft.VisualStudio.PlatformUI.DelegateCommand : Action<obj> * Microsoft.VisualStudio.Threading.JoinableTaskFactory -> Microsoft.VisualStudio.PlatformUI.DelegateCommand
Public Sub New (execute As Action(Of Object), jtf As JoinableTaskFactory)

Parameters

execute
Action<Object>

The action to run when the command is executed.

jtf
JoinableTaskFactory

The task factory for the command. If this is non-null, the command will switch to the main thread before raising the CanExecuteChanged event.

Applies to

DelegateCommand(Action<Object>, Predicate<Object>)

Initializes a new instance of the DelegateCommand class.

public:
 DelegateCommand(Action<System::Object ^> ^ execute, Predicate<System::Object ^> ^ canExecute);
public DelegateCommand (Action<object> execute, Predicate<object> canExecute);
new Microsoft.VisualStudio.PlatformUI.DelegateCommand : Action<obj> * Predicate<obj> -> Microsoft.VisualStudio.PlatformUI.DelegateCommand
Public Sub New (execute As Action(Of Object), canExecute As Predicate(Of Object))

Parameters

execute
Action<Object>

The action to run when the command is executed.

canExecute
Predicate<Object>

The function to evaluate whether this command is executable. If this parameter is null, the command is always executable.

Applies to

DelegateCommand(Action, Func<Boolean>, JoinableTaskFactory)

Initializes a new instance of the DelegateCommand class.

public:
 DelegateCommand(Action ^ execute, Func<bool> ^ canExecute, Microsoft::VisualStudio::Threading::JoinableTaskFactory ^ jtf);
public DelegateCommand (Action execute, Func<bool> canExecute, Microsoft.VisualStudio.Threading.JoinableTaskFactory jtf);
new Microsoft.VisualStudio.PlatformUI.DelegateCommand : Action * Func<bool> * Microsoft.VisualStudio.Threading.JoinableTaskFactory -> Microsoft.VisualStudio.PlatformUI.DelegateCommand
Public Sub New (execute As Action, canExecute As Func(Of Boolean), jtf As JoinableTaskFactory)

Parameters

execute
Action

The action to run when the command is executed.

canExecute
Func<Boolean>

The function to evaluate whether this command is executable. If this parameter is null, the command is always executable.

jtf
JoinableTaskFactory

The task factory for the command. If this is non-null, the command will switch to the main thread before raising the CanExecuteChanged event.

Applies to

DelegateCommand(Action<Object>, Predicate<Object>, JoinableTaskFactory)

Initializes a new instance of the DelegateCommand class.

public:
 DelegateCommand(Action<System::Object ^> ^ execute, Predicate<System::Object ^> ^ canExecute, Microsoft::VisualStudio::Threading::JoinableTaskFactory ^ jtf);
public DelegateCommand (Action<object> execute, Predicate<object> canExecute, Microsoft.VisualStudio.Threading.JoinableTaskFactory jtf);
new Microsoft.VisualStudio.PlatformUI.DelegateCommand : Action<obj> * Predicate<obj> * Microsoft.VisualStudio.Threading.JoinableTaskFactory -> Microsoft.VisualStudio.PlatformUI.DelegateCommand
Public Sub New (execute As Action(Of Object), canExecute As Predicate(Of Object), jtf As JoinableTaskFactory)

Parameters

execute
Action<Object>

The action to run when the command is executed.

canExecute
Predicate<Object>

The function to evaluate whether this command is executable. If this parameter is null, the command is always executable.

jtf
JoinableTaskFactory

The task factory for the command. If this is non-null, the command will switch to the main thread before raising the CanExecuteChanged event.

Applies to