createAsync2<TResult> method

RxCommand<Unit, TResult> createAsync2 <TResult>(AsyncFunc<TResult> func, [ Observable<bool> canExecute ])

Creates a RxCommand for an asynchronous handler function with no parameter that returns a value func: handler function canExecute : observable that can bve used to enable/diable the command based on some other state change if omitted the command can be executed always except it's already executing

Implementation

static RxCommand<Unit, TResult> createAsync2<TResult>(AsyncFunc<TResult> func,[Observable<bool> canExecute])
{
    return new RxCommandAsync<Unit,TResult>((_) async => func(),canExecute);
}