DelegateCommand<T> Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
DelegateCommand<T>(Action<T>) |
Initializes a new instance of the DelegateCommand<T> class. Using this constructor to initialize the DelegateCommand results in a command that can always execute. |
DelegateCommand<T>(Action<T>, JoinableTaskFactory) |
Initializes a new instance of the DelegateCommand<T> class. Using this constructor to initialize the DelegateCommand results in a command that can always execute. |
DelegateCommand<T>(Action<T>, Predicate<T>) |
Initializes a new instance of the DelegateCommand<T> class. |
DelegateCommand<T>(Action<T>, Predicate<T>, JoinableTaskFactory) |
Initializes a new instance of the DelegateCommand<T> class. |
DelegateCommand<T>(Action<T>)
Initializes a new instance of the DelegateCommand<T> class. Using this constructor to initialize the DelegateCommand results in a command that can always execute.
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))
Parameters
- execute
- Action<T>
The action to run when the command is executed.
Applies to
DelegateCommand<T>(Action<T>, JoinableTaskFactory)
Initializes a new instance of the DelegateCommand<T> class. Using this constructor to initialize the DelegateCommand results in a command that can always execute.
public DelegateCommand (Action<T> execute, Microsoft.VisualStudio.Threading.JoinableTaskFactory jtf);
new Microsoft.VisualStudio.PlatformUI.DelegateCommand<'T> : Action<'T> * Microsoft.VisualStudio.Threading.JoinableTaskFactory -> Microsoft.VisualStudio.PlatformUI.DelegateCommand<'T>
Public Sub New (execute As Action(Of T), jtf As JoinableTaskFactory)
Parameters
- execute
- Action<T>
The action to run when the command is executed.
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<T>(Action<T>, Predicate<T>)
Initializes a new instance of the DelegateCommand<T> class.
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))
Parameters
- execute
- Action<T>
The action to run when the command is executed.
- canExecute
- Predicate<T>
The function to evaluate whether this command is executable. If this parameter is null, the command is always executable.
Applies to
DelegateCommand<T>(Action<T>, Predicate<T>, JoinableTaskFactory)
Initializes a new instance of the DelegateCommand<T> class.
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)
Parameters
- execute
- Action<T>
The action to run when the command is executed.
- canExecute
- Predicate<T>
The function to evaluate whether this command is executable. If this parameter is null, the command is always executable.
The task factory for the command. If this is non-null, the command will switch to the main thread before raising the CanExecuteChanged event.