Search Results for

    Show / Hide Table of Contents

    Interface IAsyncRelayCommandCommon<TParam>

    An interface to define a reusable command that encapsulates the implementation of ICommand with support for async/await command delegates and data binding (implements INotifyPropertyChanged).
    Enables instant creation of an ICommand without implementing the ICommand interface for each command.

    Inherited Members
    IAsyncRelayCommandCommon.IsExecuting
    IAsyncRelayCommandCommon.CanBeCanceled
    IAsyncRelayCommandCommon.IsCancelled
    IAsyncRelayCommandCommon.IsPendingCancelled
    IAsyncRelayCommandCommon.HasPending
    IAsyncRelayCommandCommon.PendingCount
    IAsyncRelayCommandCommon.CurrentCancellationToken
    IAsyncRelayCommandCommon.CancelAll()
    IAsyncRelayCommandCommon.CancelAll(Boolean)
    IAsyncRelayCommandCommon.CancelExecuting()
    IAsyncRelayCommandCommon.CancelExecuting(Boolean)
    IAsyncRelayCommandCommon.CancelPending()
    IAsyncRelayCommandCommon.CancelPending(Boolean)
    IAsyncRelayCommandCommon.CanExecute()
    IAsyncRelayCommandCommon.ExecuteAsync()
    IAsyncRelayCommandCommon.ExecuteAsync(CancellationToken)
    IAsyncRelayCommandCommon.ExecuteAsync(TimeSpan)
    IAsyncRelayCommandCommon.ExecuteAsync(TimeSpan, CancellationToken)
    IAsyncRelayCommandCommon.InvalidateCommand()
    ICommand.CanExecute(Object)
    ICommand.Execute(Object)
    ICommand.CanExecuteChanged
    INotifyPropertyChanged.PropertyChanged
    Namespace: BionicCode.Utilities.Net
    Assembly: BionicCode.Utilities.Net.Common.dll
    Syntax
    public interface IAsyncRelayCommandCommon<TParam> : IAsyncRelayCommandCommon, ICommand, INotifyPropertyChanged
    Type Parameters
    Name Description
    TParam

    Methods

    | Improve this Doc View Source

    CanExecute(TParam)

    Checks if the ICommand can execute based on the command parameter.

    Declaration
    bool CanExecute(TParam parameter)
    Parameters
    Type Name Description
    TParam parameter

    The command parameter.

    Returns
    Type Description
    Boolean

    true when the ICommand can execute, otherwise false.

    | Improve this Doc View Source

    ExecuteAsync(TParam)

    Executes the AsyncRelayCommand on the current command target asynchronously.

    Declaration
    Task ExecuteAsync(TParam parameter)
    Parameters
    Type Name Description
    TParam parameter

    Data used by the command. If the command does not require data to be passed, this object can be set to null.

    Returns
    Type Description
    Task
    Remarks

    If the registered command handler is asynchronous (awaitable), then the execution is asynchronous otherwise the delegate is executed synchronously.

    Exceptions
    Type Condition
    OperationCanceledException

    If the executing command delegate was cancelled.

    | Improve this Doc View Source

    ExecuteAsync(TParam, CancellationToken)

    Executes the AsyncRelayCommand on the current command target asynchronously.

    Declaration
    Task ExecuteAsync(TParam parameter, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    TParam parameter

    Data used by the command. If the command does not require data to be passed, this object can be set to null.

    CancellationToken cancellationToken

    An instance of CancellationToken to cancel the executing command delegate.

    Returns
    Type Description
    Task
    Remarks

    If the registered command handler is asynchronous (awaitable), then the execution is asynchronous otherwise the delegate is executed synchronously.

    Exceptions
    Type Condition
    OperationCanceledException

    If the executing command delegate was cancelled.

    | Improve this Doc View Source

    ExecuteAsync(TParam, TimeSpan)

    Executes the AsyncRelayCommand on the current command target asynchronously.

    Declaration
    Task ExecuteAsync(TParam parameter, TimeSpan timeout)
    Parameters
    Type Name Description
    TParam parameter

    Data used by the command. If the command does not require data to be passed, this object can be set to null.

    TimeSpan timeout

    A TimeSpan to specify the timeout of the operation.
    A value of InfiniteTimeSpan (or a TimeSpan that represents -1) will specifiy an infinite time out.
    A value of Zero will cancel the operation immediately.

    Returns
    Type Description
    Task
    Remarks

    If the registered command handler is asynchronous (awaitable), then the execution is asynchronous otherwise the delegate is executed synchronously.

    Exceptions
    Type Condition
    OperationCanceledException

    If the executing command delegate was cancelled.

    ArgumentOutOfRangeException

    timeout>>.TotalMilliseconds is less than -1 or greater than MaxValue (or MaxValue - 1 on some versions of .NET).
    Note that this upper bound is more restrictive than MaxValue.

    | Improve this Doc View Source

    ExecuteAsync(TParam, TimeSpan, CancellationToken)

    Executes the AsyncRelayCommand on the current command target asynchronously.

    Declaration
    Task ExecuteAsync(TParam parameter, TimeSpan timeout, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    TParam parameter

    Data used by the command. If the command does not require data to be passed, this object can be set to null.

    TimeSpan timeout

    A TimeSpan to specify the timeout of the operation.
    A value of InfiniteTimeSpan (or a TimeSpan that represents -1) will specifiy an infinite time out.
    A value of Zero will cancel the operation immediately.

    CancellationToken cancellationToken

    An instance of CancellationToken to cancel the executing command delegate.

    Returns
    Type Description
    Task
    Remarks

    If the registered command handler is asynchronous (awaitable), then the execution is asynchronous otherwise the delegate is executed synchronously.

    Exceptions
    Type Condition
    OperationCanceledException

    If the executing command delegate was cancelled.

    ArgumentOutOfRangeException

    timeout>>.TotalMilliseconds is less than -1 or greater than MaxValue (or MaxValue - 1 on some versions of .NET). Note that this upper bound is more restrictive than MaxValue.

    Extension Methods

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