Example #1
0
        public static async ValueTask <bool> TryExecuteAsync <T>(this IAsyncCommandSlim <T> command, T parameter)
        {
            if (command.CanExecute(parameter))
            {
                await command.ExecuteAsync(parameter);

                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
        public static async ValueTask <bool> TryExecuteAsync(this IAsyncCommandSlim command)
        {
            if (command.CanExecute())
            {
                await command.ExecuteAsync();

                return(true);
            }
            else
            {
                return(false);
            }
        }