Click or drag to resize

AsyncRelayCommand Class

A reusable command that encapsulates the implementation of ICommand with support for async/await. Enables instant creation of an ICommand without implementing the ICommand interface for each command. The individual Execute, ExecuteAsync and CanExecute members are supplied via delegates.
Inheritance Hierarchy

Namespace:  BionicCode.Utilities.Net.Core.Wpf
Assembly:  BionicCode.Utilities.Net.Core.Wpf (in BionicCode.Utilities.Net.Core.Wpf.dll) Version: 1.0.2
Syntax
public class AsyncRelayCommand : IAsyncRelayCommand, 
	ICommand

The AsyncRelayCommand type exposes the following members.

Constructors
  NameDescription
Public methodAsyncRelayCommand(Action)
Creates a new parameterless command that can always execute (CanExecute will always return true).
Public methodAsyncRelayCommand(ActionObject)
Creates a new command that can always execute (CanExecute will always return true).
Public methodAsyncRelayCommand(FuncTask)
Creates a new parameterless asynchronous command that can always execute (CanExecute will always return true).
Public methodAsyncRelayCommand(FuncObject, Task)
Creates a new command that can always execute (CanExecute will always return true).
Public methodAsyncRelayCommand(Action, FuncBoolean)
Creates a new parameterless command.
Public methodAsyncRelayCommand(ActionObject, PredicateObject)
Creates a new command.
Public methodAsyncRelayCommand(FuncTask, FuncBoolean)
Creates a parameterless new asynchronous command.
Public methodAsyncRelayCommand(FuncObject, Task, PredicateObject)
Creates a new asynchronous command.
Top
Methods
  NameDescription
Public methodCanExecute
Determines whether this AsyncRelayCommand can execute.
Public methodCanExecute(Object)
Determines whether this AsyncRelayCommand can execute.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodExecute
Executes the ICommand on the current command target.
Public methodExecute(Object)
Executes the AsyncRelayCommand on the current command target.
Public methodExecuteAsync
Executes the AsyncRelayCommand on the current command target asynchronously.
Public methodExecuteAsync(Object)
Executes the AsyncRelayCommand on the current command target asynchronously.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Events
  NameDescription
Public eventCanExecuteChanged
Raised when RaiseCanExecuteChanged is called.
Top
Fields
  NameDescription
Protected fieldCanExecuteNoParam
The registered parameterless CanExecute delegate.
Protected fieldExecuteAsyncNoParam
The registered parameterless async execute delegate.
Protected fieldExecuteNoParam
The registered parameterless synchronous execute delegate.
Top
Extension Methods
Remarks
AsyncRelayCommand implements ICommand
See Also
https://github.com/BionicCode/BionicCode.Net/blob/master/README.md