Command<T> Constructors

Definition

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.

canExecute
Func<T,Boolean>

A function that determines if the command can execute.

Remarks

Whenever the value returned by canExecute has changed, a call to ChangeCanExecute() is required to trigger CanExecuteChanged.

Applies to