Пример #1
0
        public HomeViewModel(IViewStackService viewStackService) : base(viewStackService)
        {
            OpenModal = ReactiveCommand
                        .CreateFromObservable(() =>
                                              this.ViewStackService.PushModal(new FirstModalViewModel(ViewStackService)),
                                              outputScheduler: RxApp.MainThreadScheduler);

            PushPage = ReactiveCommand
                       .CreateFromObservable(() =>
                                             this.ViewStackService.PushPage(new RedViewModel(ViewStackService)),
                                             outputScheduler: RxApp.MainThreadScheduler);

            OpenModal.Subscribe(x => Debug.WriteLine("PagePushed"));
        }
Пример #2
0
        public FirstModalViewModel(IViewStackService viewStackService) : base(viewStackService)
        {
            OpenModal = ReactiveCommand
                        .CreateFromObservable(() =>
                                              this.ViewStackService.PushModal(new SecondModalViewModel(viewStackService)),
                                              outputScheduler: RxApp.MainThreadScheduler);

            PopModal = ReactiveCommand
                       .CreateFromObservable(() =>
                                             this.ViewStackService.PopModal(),
                                             outputScheduler: RxApp.MainThreadScheduler);

            OpenModal.Subscribe(x => Debug.WriteLine("PagePushed"));
            PopModal.Subscribe(x => Debug.WriteLine("PagePoped"));
            PopModal.ThrownExceptions.Subscribe(error => Interactions.ErrorMessage.Handle(error).Subscribe());
        }
Пример #3
0
        public FirstModalViewModel(INavigationService navigationService) : base(navigationService)
        {
            OpenModal = ReactiveCommand
                        .CreateFromObservable(() =>
                                              NavigationService.PushModal(new SecondModalViewModel(NavigationService)),
                                              outputScheduler: RxApp.MainThreadScheduler);

            PopModal = ReactiveCommand
                       .CreateFromObservable(() =>
                                             NavigationService.PopModal(),
                                             outputScheduler: RxApp.MainThreadScheduler);

            OpenModal.Subscribe(x => System.Diagnostics.Debug.WriteLine("PagePushed"));
            PopModal.Subscribe(x => System.Diagnostics.Debug.WriteLine("PagePopped"));
            PopModal.ThrownExceptions.Subscribe(error => Interactions.ErrorMessage.Handle(error).Subscribe());
        }