private static IObservable <T> StopBusy(ReactiveViewModel viewModel, IObservable <T> observable)
 {
     return(observable
            .Catch <T, Exception>(ex =>
     {
         viewModel.ThrownExceptionsSource.OnNext(ex);
         return Observable.Return <T>(default(T));
     })
            .Do(_ => viewModel.AsyncNavigatingSource.OnNext(false)));
 }
 public NavigationObservable(ReactiveViewModel viewModel, IObservable <T> observable)
 {
     _viewModel  = viewModel;
     _observable = observable;
 }
 public static IObservable <INavigationParameters> ObservableForClosed(this ReactiveViewModel This)
 {
     return(This.Closed);
 }
 private static IObservable <T> StartBusy(ReactiveViewModel viewModel, IObservable <T> observable)
 {
     return(observable.Do(_ => viewModel.AsyncNavigatingSource.OnNext(true)));
 }
 public static INavigationObservable <INavigationParameters> WhenNavigatedTo(this ReactiveViewModel This)
 {
     return(new NavigationObservable <INavigationParameters>(This, This.NavigatedTo));
 }
 public static IObservable <INavigationParameters> ObservableForNavigatedTo(this ReactiveViewModel This)
 {
     return(This.NavigatedTo);
 }
        public static ReactiveCommand <TParam, TResult> CreateAsyncObservableCommand <TParam, TResult>(this ReactiveViewModel This, IObservable <bool> canExecute, Func <TParam, TResult> executeAsync, IScheduler scheduler = null)
        {
            var sched = scheduler ?? RxApp.MainThreadScheduler;

            return(ReactiveCommand.CreateFromObservable <TParam, TResult>(x => Observable.Start(() => executeAsync(x), sched), canExecute));
        }
        public static ReactiveCommand <TParam, Unit> CreateAsyncObservableCommand <TParam>(this ReactiveViewModel This, Action <TParam> executeAsync, IScheduler scheduler = null)
        {
            var sched = scheduler ?? RxApp.MainThreadScheduler;

            return(ReactiveCommand.CreateFromObservable <TParam, Unit>(x => Observable.Start(() => executeAsync(x), sched)));
        }
 public static INavigationObservable <INavigationParameters> WhenClosed(this ReactiveViewModel This)
 {
     return(new NavigationObservable <INavigationParameters>(This, This.Closed));
 }