Command<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
| Name | Description |
|---|---|
| Command<T>(Action<T>) |
Creates a new command with the specified execute action. |
| Command<T>(Action<T>, Func<T,Boolean>) |
Creates a new command with the specified execute and canExecute delegates. |
Command<T>(Action<T>)
- Source:
- Command.cs
- Source:
- Command.cs
- Source:
- Command.cs
- Source:
- Command.cs
Creates a new command with the specified execute action.
public:
Command(Action<T> ^ execute);
public Command(Action<T> execute);
new Microsoft.Maui.Controls.Command<'T> : Action<'T> -> Microsoft.Maui.Controls.Command<'T>
Public Sub New (execute As Action(Of T))
Parameters
- execute
- Action<T>
The action to execute when the command is invoked.
Applies to
Command<T>(Action<T>, Func<T,Boolean>)
- Source:
- Command.cs
- Source:
- Command.cs
- Source:
- Command.cs
- Source:
- Command.cs
Creates a new command with the specified execute and canExecute delegates.
public:
Command(Action<T> ^ execute, Func<T, bool> ^ canExecute);
public Command(Action<T> execute, Func<T,bool> canExecute);
new Microsoft.Maui.Controls.Command<'T> : Action<'T> * Func<'T, bool> -> Microsoft.Maui.Controls.Command<'T>
Public Sub New (execute As Action(Of T), canExecute As Func(Of T, Boolean))
Parameters
- execute
- Action<T>
The action to execute when the command is invoked.
Remarks
Whenever the value returned by canExecute has changed, a call to ChangeCanExecute() is required to trigger CanExecuteChanged.