Search Results for

    Show / Hide Table of Contents

    Class AsyncRelayCommand

    A reusable command that encapsulates the implementation of ICommand with support for async/await command delegates.
    Enables instant creation of an ICommand without implementing the ICommand interface for each command. The AsyncRelayCommand<TParam> accepts asynchronous command handlers and supports data bindng to properties like IsExecuting by implementing INotifyPropertyChanged.
    Call and await the ExecuteAsync() method or one of its overloads to execute the command explicitly asynchronously. ICommand

    Inheritance
    Object
    AsyncRelayCommandCommon
    AsyncRelayCommand
    Implements
    IAsyncRelayCommand
    IAsyncRelayCommandCommon
    ICommand
    INotifyPropertyChanged
    Inherited Members
    AsyncRelayCommandCommon.MaxThreads
    AsyncRelayCommandCommon.IsExecuting
    AsyncRelayCommandCommon.IsPendingCancelled
    AsyncRelayCommandCommon.IsCancelled
    AsyncRelayCommandCommon.HasPending
    AsyncRelayCommandCommon.PendingCount
    AsyncRelayCommandCommon.CanBeCanceled
    AsyncRelayCommandCommon.CurrentCancellationToken
    AsyncRelayCommandCommon.PropertyChanged
    AsyncRelayCommandCommon.ExecuteAsyncNoParamDelegate
    AsyncRelayCommandCommon.ExecuteCancellableAsyncNoParamDelegate
    AsyncRelayCommandCommon.ExecuteNoParamDelegate
    AsyncRelayCommandCommon.ExecuteCancellableNoParamDelegate
    AsyncRelayCommandCommon.CanExecuteNoParamDelegate
    AsyncRelayCommandCommon.CanExecuteChanged
    AsyncRelayCommandCommon.CanExecute()
    AsyncRelayCommandCommon.ExecuteAsync()
    AsyncRelayCommandCommon.ExecuteAsync(CancellationToken)
    AsyncRelayCommandCommon.ExecuteAsync(TimeSpan)
    AsyncRelayCommandCommon.ExecuteAsync(TimeSpan, CancellationToken)
    AsyncRelayCommandCommon.TryExecuteNoParamCommand()
    AsyncRelayCommandCommon.CancelExecuting()
    AsyncRelayCommandCommon.CancelExecuting(Boolean)
    AsyncRelayCommandCommon.CancelPending()
    AsyncRelayCommandCommon.CancelPending(Boolean)
    AsyncRelayCommandCommon.CancelAll()
    AsyncRelayCommandCommon.CancelAll(Boolean)
    AsyncRelayCommandCommon.InvalidateCommand()
    AsyncRelayCommandCommon.OnCanExecuteChanged()
    AsyncRelayCommandCommon.OnPropertyChanged(String)
    AsyncRelayCommandCommon.ICommand.CanExecute(Object)
    AsyncRelayCommandCommon.ICommand.Execute(Object)
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: BionicCode.Utilities.Net
    Assembly: BionicCode.Utilities.Net.dll
    Syntax
    public class AsyncRelayCommand : AsyncRelayCommandCommon, IAsyncRelayCommand, IAsyncRelayCommandCommon, ICommand, INotifyPropertyChanged
    Remarks

    AsyncRelayCommand implements ICommand. In case the AsyncRelayCommand<TParam> is executed explicitly, especially with an asynchronous command handler registered, it is highly recommended to invoke the awaitable ExecuteAsync() or its overloads instead.

    Constructors

    | Improve this Doc View Source

    AsyncRelayCommand()

    Declaration
    protected AsyncRelayCommand()
    | Improve this Doc View Source

    AsyncRelayCommand(Action)

    Creates a new parameterless synchronous command that can always execute (CanExecute() will always return true).

    Declaration
    public AsyncRelayCommand(Action executeNoParam)
    Parameters
    Type Name Description
    Action executeNoParam

    The awaitable execution handler.

    | Improve this Doc View Source

    AsyncRelayCommand(Action, Func<Boolean>)

    Creates a new parameterless synchronous command.

    Declaration
    public AsyncRelayCommand(Action executeNoParam, Func<bool> canExecuteNoParam)
    Parameters
    Type Name Description
    Action executeNoParam

    The execution handler.

    Func<Boolean> canExecuteNoParam

    The execution status handler.

    | Improve this Doc View Source

    AsyncRelayCommand(Action<CancellationToken>)

    Creates a new parameterless synchronous command that can always execute (CanExecute() will always return true)
    and supports cancellation.

    Declaration
    public AsyncRelayCommand(Action<CancellationToken> executeNoParam)
    Parameters
    Type Name Description
    Action<CancellationToken> executeNoParam

    The awaitable execution handler.

    | Improve this Doc View Source

    AsyncRelayCommand(Action<CancellationToken>, Func<Boolean>)

    Declaration
    public AsyncRelayCommand(Action<CancellationToken> executeAsync, Func<bool> canExecute)
    Parameters
    Type Name Description
    Action<CancellationToken> executeAsync
    Func<Boolean> canExecute
    | Improve this Doc View Source

    AsyncRelayCommand(Func<CancellationToken, Task>)

    Creates a new parameterless asynchronous command that can always execute (CanExecute() will always return true)
    and supports cancellation.

    Declaration
    public AsyncRelayCommand(Func<CancellationToken, Task> executeAsyncNoParam)
    Parameters
    Type Name Description
    Func<CancellationToken, Task> executeAsyncNoParam

    The awaitable execution handler.

    | Improve this Doc View Source

    AsyncRelayCommand(Func<CancellationToken, Task>, Func<Boolean>)

    Creates a new parameterless asynchronous command that supports cancellation and does not take a command parameter.

    Declaration
    public AsyncRelayCommand(Func<CancellationToken, Task> executeAsync, Func<bool> canExecute)
    Parameters
    Type Name Description
    Func<CancellationToken, Task> executeAsync

    The awaitable execution handler.

    Func<Boolean> canExecute

    The can execute handler.

    | Improve this Doc View Source

    AsyncRelayCommand(Func<Task>)

    Creates a new parameterless asynchronous command that can always execute (CanExecute() will always return true).

    Declaration
    public AsyncRelayCommand(Func<Task> executeAsyncNoParam)
    Parameters
    Type Name Description
    Func<Task> executeAsyncNoParam

    The awaitable execution handler.

    | Improve this Doc View Source

    AsyncRelayCommand(Func<Task>, Func<Boolean>)

    Creates a parameterless new asynchronous command.

    Declaration
    public AsyncRelayCommand(Func<Task> executeAsyncNoParam, Func<bool> canExecuteNoParam)
    Parameters
    Type Name Description
    Func<Task> executeAsyncNoParam

    The awaitable execution handler.

    Func<Boolean> canExecuteNoParam

    The execution status handler.

    Implements

    IAsyncRelayCommand
    IAsyncRelayCommandCommon
    ICommand
    INotifyPropertyChanged

    Extension Methods

    HelperExtensionsCommon.ToDictionary(Object)
    HelperExtensionsCommon.ToFlatDictionary(Object)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX