コード例 #1
0
		public NavigationContainerPage ()
		{
			var primaryNavPage = new NavigationPage(navListPage){
				Title = "Reactive Examples",
			};

			Master = primaryNavPage;

			this.MasterBehavior = MasterBehavior.Popover;
			this.IsPresented = true;

			navListPage.SelectedNavigation
				.ObserveOn (RxApp.MainThreadScheduler)
				.StartWith(NavigationPages.Delay)
				.Subscribe (navPage => {

					Page selectedPage = null;
					switch (navPage) {
						case NavigationPages.Async:
							selectedPage = new Pages.Async();
							break;
						case NavigationPages.AsyncEvents:
							selectedPage = new Pages.AsyncEvent();
							break;
						case NavigationPages.Delay:
							selectedPage = new Pages.Delay();
							break;
						case NavigationPages.Throttle:
							selectedPage = new Pages.Throttle();
							break;
						case NavigationPages.Buffer:
							selectedPage = new Pages.Buffer();
							break;
						case NavigationPages.BufferWithWhere:
							selectedPage = new Pages.BufferWithWhere();
							break;
						case NavigationPages.Merge:
							selectedPage = new Pages.Merge();
							break;
						case NavigationPages.Sample:
							selectedPage = new Pages.Sample();
							break;
						case NavigationPages.Scan:
							selectedPage = new Pages.Scan();
							break;
						case NavigationPages.AsyncToObservable:
							selectedPage = new Pages.AsyncToObservable ();
							break;
						case NavigationPages.CombineLatest:
							selectedPage = new Pages.CombineLatest ();
							break;
						case NavigationPages.StandardSearch:
							selectedPage = new Pages.StandardSearch();
							break;
						case NavigationPages.SearchWithReactiveExtensions:
							selectedPage = new Pages.SearchWithReactiveExtensions();
							break;
						case NavigationPages.RxUiSearch:
							selectedPage = new Pages.ReactiveUiSearch();
							break;						
						case NavigationPages.RxUiColorSlider:
							selectedPage = new Pages.ReactiveUiColorSlider();
							break;
						case NavigationPages.RxUiLogin:
							selectedPage = new Pages.ReactiveUiLogin();
							break;
						case NavigationPages.Akavache:
							selectedPage = new Pages.Akavache();
							break;
						default:
						break;
					}

					if(selectedPage != null) {
						var detailNavPage = new NavigationPage(selectedPage) {};

						Detail = detailNavPage;
					}

					this.IsPresented = false;
				
				});
		}
コード例 #2
0
        public NavigationContainerPage()
        {
            Master = new NavigationPage(navListPage)
            {
                Title              = "Reactive Examples",
                BarTextColor       = Color.White,
                BarBackgroundColor = Color.Gray,
                Icon = "slideout.png"
            };

            this.MasterBehavior = MasterBehavior.Popover;

            navListPage.SelectedNavigation
            .ObserveOn(RxApp.MainThreadScheduler)
            .StartWith(NavigationPages.Delay)
            .Subscribe(navPage => {
                Page selectedPage = null;
                switch (navPage)
                {
                case NavigationPages.Async:
                    selectedPage = new Pages.Async();
                    break;

                case NavigationPages.AsyncEvents:
                    selectedPage = new Pages.AsyncEvent();
                    break;

                case NavigationPages.Delay:
                    selectedPage = new Pages.Delay();
                    break;

                case NavigationPages.Throttle:
                    selectedPage = new Pages.Throttle();
                    break;

                case NavigationPages.Buffer:
                    selectedPage = new Pages.Buffer();
                    break;

                case NavigationPages.BufferWithWhere:
                    selectedPage = new Pages.BufferWithWhere();
                    break;

                case NavigationPages.Merge:
                    selectedPage = new Pages.Merge();
                    break;

                case NavigationPages.Sample:
                    selectedPage = new Pages.Sample();
                    break;

                case NavigationPages.AsyncToObservable:
                    selectedPage = new Pages.AsyncToObservable();
                    break;

                case NavigationPages.CombineLatest:
                    selectedPage = new Pages.CombineLatest();
                    break;

                case NavigationPages.RxUiColorSlider:
                    selectedPage = new Pages.ReactiveUiColorSlider();
                    break;

                case NavigationPages.RxUiLogin:
                    selectedPage = new Pages.ReactiveUiLogin();
                    break;

                case NavigationPages.Akavache:
                    selectedPage = new Pages.Akavache();
                    break;

                default:
                    break;
                }

                if (selectedPage != null)
                {
                    Detail =
                        new NavigationPage(selectedPage)
                    {
                        BarBackgroundColor = Color.Gray,
                        BarTextColor       = Color.White,
                    }
                }
                ;

                this.IsPresented = false;
            });
        }