Compartilhar via


DelegateCommand<T> Construtores

Definição

Sobrecargas

DelegateCommand<T>(Action<T>)

Inicializa uma nova instância da classe DelegateCommand<T>. Usar esse construtor para inicializar o DelegateCommand resulta em um comando que sempre pode ser executado.

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

Inicializa uma nova instância da classe DelegateCommand<T>.

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

Inicializa uma nova instância da classe DelegateCommand<T>.

DelegateCommand<T>(Action<T>)

Inicializa uma nova instância da classe DelegateCommand<T>. Usar esse construtor para inicializar o DelegateCommand resulta em um comando que sempre pode ser executado.

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

Parâmetros

execute
Action<T>

A ação a ser executada quando o comando é executado.

Aplica-se a

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

Inicializa uma nova instância da classe DelegateCommand<T>.

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

Parâmetros

execute
Action<T>

A ação a ser executada quando o comando é executado.

canExecute
Predicate<T>

A função a ser avaliada se esse comando é executável. Se esse parâmetro for nulo, o comando será sempre executável.

Aplica-se a

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

Inicializa uma nova instância da classe DelegateCommand<T>.

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

Parâmetros

execute
Action<T>

A ação a ser executada quando o comando é executado.

canExecute
Predicate<T>

A função a ser avaliada se esse comando é executável. Se esse parâmetro for nulo, o comando será sempre executável.

jtf
JoinableTaskFactory

A fábrica de tarefas para o comando . Se isso não for nulo, o comando alternará para o thread main antes de gerar o CanExecuteChanged evento.

Aplica-se a