Пример #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());
 }
Пример #2
0
 /// <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));
 }