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