public static IObservable <Unit> ToCommandWithSignalArgs <TSignal>( this BindSignalIdToBinder <TSignal> builder, ICommand <Unit, TSignal> command) { return(Observable.Create <Unit>(observer => { builder.ToMethod(signal => { command .Execute(signal) .Subscribe(result => { observer.OnNext(result); observer.OnCompleted(); }); }); return Disposable.Empty; })); }
public static IObservable <Unit> ToCommand <TSignal, TCommand>(this BindSignalIdToBinder <TSignal> builder) where TCommand : ICommand { return(Observable.Create <Unit>(observer => { builder.ToMethod(() => { Container.Instantiate <TCommand>() .Execute() .Subscribe(result => { observer.OnNext(result); observer.OnCompleted(); }); }); return Disposable.Empty; })); }