DelegateCommand<T> 建構函式

定義

多載

DelegateCommand<T>(Action<T>)

初始化 DelegateCommand<T> 類別的新執行個體。 使用此建構函式來初始化 DelegateCommand 會產生一律可執行檔命令。

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

初始化 DelegateCommand<T> 類別的新執行個體。

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

初始化 DelegateCommand<T> 類別的新執行個體。

DelegateCommand<T>(Action<T>)

初始化 DelegateCommand<T> 類別的新執行個體。 使用此建構函式來初始化 DelegateCommand 會產生一律可執行檔命令。

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))

參數

execute
Action<T>

執行命令時要執行的動作。

適用於

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

初始化 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))

參數

execute
Action<T>

執行命令時要執行的動作。

canExecute
Predicate<T>

要評估此命令是否可執行檔函式。 如果此參數為 null,則命令一律為可執行檔。

適用於

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

初始化 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)

參數

execute
Action<T>

執行命令時要執行的動作。

canExecute
Predicate<T>

要評估此命令是否可執行檔函式。 如果此參數為 null,則命令一律為可執行檔。

jtf
JoinableTaskFactory

命令的工作處理站。 如果這是非 Null,命令會在引發 CanExecuteChanged 事件之前切換至主執行緒。

適用於