示例#1
0
 /// <summary>
 /// A utility method that will pipe an Observable to an ICommand (i.e.
 /// it will first call its CanExecute with the provided value, then if
 /// the command can be executed, Execute() will be called)
 /// </summary>
 /// <param name="command">The command to be executed.</param>
 /// <returns>An object that when disposes, disconnects the Observable
 /// from the command.</returns>
 public static IDisposable InvokeCommand <T, TResult>(this IObservable <T> This, ReactiveCommand <T, TResult> command)
 {
     return(This.Throttle(x => command.CanExecute.Where(b => b))
            .Select(x => command.Execute(x).Catch(Observable.Empty <TResult>()))
            .Switch()
            .Subscribe());
 }
 /// <inheritdoc/>
 public override IObservable <IList <TResult> > Execute(TParam parameter) => _innerCommand.Execute(parameter);
示例#3
0
 /// <inheritdoc/>
 public override IObservable <IList <TResult> > Execute(TParam parameter = default(TParam))
 {
     return(_innerCommand.Execute(parameter));
 }