{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Constructor AsyncRelayCommand | App UI | 0.5.5
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Constructor AsyncRelayCommand

    AsyncRelayCommand(Func<T?, Task>)

    Initializes a new instance of the AsyncRelayCommand<T> class.

    Declaration
    public AsyncRelayCommand(Func<T?, Task> execute)
    Parameters
    Type Name Description
    Func<T, Task> execute

    The Func<T, TResult> to invoke when the command is executed.

    Exceptions
    Type Condition
    ArgumentNullException

    execute is null.

    AsyncRelayCommand(Func<T?, Task>, AsyncRelayCommandOptions)

    Initializes a new instance of the AsyncRelayCommand<T> class.

    Declaration
    public AsyncRelayCommand(Func<T?, Task> execute, AsyncRelayCommandOptions options)
    Parameters
    Type Name Description
    Func<T, Task> execute

    The Func<T, TResult> to invoke when the command is executed.

    AsyncRelayCommandOptions options

    The AsyncRelayCommandOptions to use when executing the command.

    Exceptions
    Type Condition
    ArgumentNullException

    execute is null.

    AsyncRelayCommand(Func<T?, CancellationToken, Task>)

    Initializes a new instance of the AsyncRelayCommand<T> class.

    Declaration
    public AsyncRelayCommand(Func<T?, CancellationToken, Task> cancellableExecute)
    Parameters
    Type Name Description
    Func<T, CancellationToken, Task> cancellableExecute

    The Func<T1, T2, TResult> to invoke when the command is executed.

    Exceptions
    Type Condition
    ArgumentNullException

    cancellableExecute is null.

    AsyncRelayCommand(Func<T?, CancellationToken, Task>, AsyncRelayCommandOptions)

    Initializes a new instance of the AsyncRelayCommand<T> class.

    Declaration
    public AsyncRelayCommand(Func<T?, CancellationToken, Task> cancellableExecute, AsyncRelayCommandOptions options)
    Parameters
    Type Name Description
    Func<T, CancellationToken, Task> cancellableExecute

    The Func<T1, T2, TResult> to invoke when the command is executed.

    AsyncRelayCommandOptions options

    The AsyncRelayCommandOptions to use when executing the command.

    Exceptions
    Type Condition
    ArgumentNullException

    cancellableExecute is null.

    AsyncRelayCommand(Func<T?, Task>, Predicate<T?>)

    Initializes a new instance of the AsyncRelayCommand<T> class.

    Declaration
    public AsyncRelayCommand(Func<T?, Task> execute, Predicate<T?> canExecute)
    Parameters
    Type Name Description
    Func<T, Task> execute

    The Func<T, TResult> to invoke when the command is executed.

    Predicate<T> canExecute

    The Predicate<T> to invoke to determine whether the command can execute.

    Exceptions
    Type Condition
    ArgumentNullException

    execute or canExecute is null.

    AsyncRelayCommand(Func<T?, Task>, Predicate<T?>, AsyncRelayCommandOptions)

    Initializes a new instance of the AsyncRelayCommand<T> class.

    Declaration
    public AsyncRelayCommand(Func<T?, Task> execute, Predicate<T?> canExecute, AsyncRelayCommandOptions options)
    Parameters
    Type Name Description
    Func<T, Task> execute

    The Func<T1, T2, TResult> to invoke when the command is executed.

    Predicate<T> canExecute

    The Predicate<T> to invoke to determine whether the command can execute.

    AsyncRelayCommandOptions options

    The AsyncRelayCommandOptions to use when executing the command.

    Exceptions
    Type Condition
    ArgumentNullException

    execute or canExecute is null.

    AsyncRelayCommand(Func<T?, CancellationToken, Task>, Predicate<T?>)

    Initializes a new instance of the AsyncRelayCommand<T> class.

    Declaration
    public AsyncRelayCommand(Func<T?, CancellationToken, Task> cancellableExecute, Predicate<T?> canExecute)
    Parameters
    Type Name Description
    Func<T, CancellationToken, Task> cancellableExecute

    The Func<T1, T2, TResult> to invoke when the command is executed.

    Predicate<T> canExecute

    The Predicate<T> to invoke to determine whether the command can execute.

    Exceptions
    Type Condition
    ArgumentNullException

    cancellableExecute or canExecute is null.

    AsyncRelayCommand(Func<T?, CancellationToken, Task>, Predicate<T?>, AsyncRelayCommandOptions)

    Initializes a new instance of the AsyncRelayCommand<T> class.

    Declaration
    public AsyncRelayCommand(Func<T?, CancellationToken, Task> cancellableExecute, Predicate<T?> canExecute, AsyncRelayCommandOptions options)
    Parameters
    Type Name Description
    Func<T, CancellationToken, Task> cancellableExecute

    The Func<T1, T2, TResult> to invoke when the command is executed.

    Predicate<T> canExecute

    The Predicate<T> to invoke to determine whether the command can execute.

    AsyncRelayCommandOptions options

    The AsyncRelayCommandOptions to use when executing the command.

    Exceptions
    Type Condition
    ArgumentNullException

    cancellableExecute or canExecute is null.

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)