Share via


AsyncValueCommand<T> Class

Definition

An implementation of IAsyncValueCommand. Allows Commands to safely be used asynchronously with Task.

public class AsyncValueCommand<T> : Xamarin.CommunityToolkit.ObjectModel.Internals.BaseAsyncValueCommand<T,object>, System.Windows.Input.ICommand, Xamarin.CommunityToolkit.ObjectModel.IAsyncValueCommand<T>

Type Parameters

T
Inheritance
System.Object
BaseAsyncValueCommand<T,System.Object>
AsyncValueCommand<T>
Implements
System.Windows.Input.ICommand IAsyncValueCommand<T>

Constructors

AsyncValueCommand<T>(Func<T,ValueTask>, Func<Boolean>, Action<Exception>, Boolean, Boolean)

Initializes a new instance of AsyncValueCommand

AsyncValueCommand<T>(Func<T,ValueTask>, Func<Object,Boolean>, Action<Exception>, Boolean, Boolean)

Initializes a new instance of AsyncValueCommand

Properties

AllowsMultipleExecutions

Returns true if the Command allows simultaneous executions

(Inherited from BaseCommand<TCanExecute>)
ExecutionCount (Inherited from BaseCommand<TCanExecute>)
IsExecuting

Returns true when the Command is currently executing. Returns false when the Command is not executing

(Inherited from BaseCommand<TCanExecute>)

Methods

CanExecute(TCanExecute)

Determines whether the command can execute in its current state

(Inherited from BaseCommand<TCanExecute>)
ChangeCanExecute()

Raises the ICommand.CanExecuteChanged event. Recommend using RaiseCanExecuteChanged() instead.

(Inherited from BaseCommand<TCanExecute>)
ExecuteAsync(T)

Executes the Command as a ValueTask

RaiseCanExecuteChanged()

Raises the ICommand.CanExecuteChanged event.

(Inherited from BaseCommand<TCanExecute>)

Events

CanExecuteChanged

Occurs when changes occur that affect whether or not the command should execute

(Inherited from BaseCommand<TCanExecute>)

Explicit Interface Implementations

ICommand.CanExecute(Object) (Inherited from BaseAsyncValueCommand<TExecute,TCanExecute>)
ICommand.Execute(Object) (Inherited from BaseAsyncValueCommand<TExecute,TCanExecute>)

Applies to