Example #1
0
        public App()
        {
            InitializeComponent();
            var name = string.Empty;

            switch (Device.RuntimePlatform)
            {
            case Device.Android:
                name = "안드로이드";
                break;

            case Device.iOS:
                name = "아이폰";
                break;

            default:
                break;
            }
            //MainPage = new TabbedPage() //탭바가 생김
            MainPage = new CarouselPage() //탭바가 생기지 않음
            {
                Children =
                {
                    new FirstPage(),
                    new SecondPage(),
                    new ThirdPage("")
                }
            };
        }
        protected override void Dispose(bool disposing)
        {
            if (disposing && _page != null)
            {
                foreach (Element element in ElementController.LogicalChildren)
                {
                    var childPage = element as VisualElement;

                    if (childPage == null)
                    {
                        continue;
                    }

                    IVisualElementRenderer childPageRenderer = Platform.GetRenderer(childPage);
                    if (childPageRenderer != null)
                    {
                        childPageRenderer.View.RemoveFromParent();
                        childPageRenderer.Dispose();
                        Platform.SetRenderer(childPage, null);
                    }
                }
                _page.PagesChanged -= OnPagesChanged;
                _page = null;
            }
            base.Dispose(disposing);
        }
Example #3
0
        public App()
        {
            InitializeComponent();

            var np = new NavigationPage(new NavPage1());

            var tp = new TabbedPage();

            tp.Children.Add(new TabPage1());
            tp.Children.Add(new TabPage2());
            tp.Children.Add(new TabPage3());

            var cp = new CarouselPage();

            cp.Children.Add(new TabPage1());
            cp.Children.Add(new TabPage2());
            cp.Children.Add(new TabPage3());

            var mp = new MasterDetailPage();

            mp.Master = new ManuPage();
            mp.Detail = new NavigationPage(new ICT13580005APage());

            MainPage = mp;
        }
Example #4
0
        public virtual async Task <bool> ShowCarouselPage(
            Type view,
            MvxCarouselPagePresentationAttribute attribute,
            MvxViewModelRequest request)
        {
            var page = await CloseAndCreatePage(view, request, attribute);

            if (attribute.Position == CarouselPosition.Root)
            {
                if (!(page is MvxCarouselPage carouselPageRoot))
                {
                    throw new MvxException($"A root page should be of type {nameof(MvxCarouselPage)}");
                }

                await PushOrReplacePage(FormsApplication.MainPage, page, attribute);
            }
            else
            {
                var carouselHost = GetPageOfType <CarouselPage>();
                if (carouselHost == null)
                {
                    MvxFormsLog.Instance.Trace($"Current root is not a CarouselPage show your own first to use custom Host. Assuming we need to create one.");
                    carouselHost = new CarouselPage();
                    await PushOrReplacePage(FormsApplication.MainPage, carouselHost, attribute);
                }
                carouselHost.Children.Add(page as ContentPage);
            }
            return(true);
        }
Example #5
0
        void UpdateCurrentPage(bool animated = true)
        {
            ContentPage current = Carousel.CurrentPage;

            if (current != null)
            {
                int index = Carousel.CurrentPage != null?CarouselPage.GetIndex(Carousel.CurrentPage) : 0;

                if (index < 0)
                {
                    index = 0;
                }

                if (SelectedIndex == index)
                {
                    return;
                }

                if (animated)
                {
                    NSAnimationContext.RunAnimation(context => { ((NSPageController)Animator).SelectedIndex = index; },
                                                    CompleteTransition);
                }
                else
                {
                    SelectedIndex = index;
                }
            }
        }
        public App()
        {
            Device.SetFlags(new[] { "Markup_Experimental" });

            var carouselPage1 = new GatePage("Page 1", 3)
            {
                BackgroundColor = Color.Maroon
            };
            var carouselPage2 = new GatePage("Page 2", 3)
            {
                BackgroundColor = Color.Green
            };
            var carouselPage3 = new GatePage("Page 3", 3)
            {
                BackgroundColor = Color.Fuchsia
            };
            var mainCarouselPage = new CarouselPage
            {
                Children =
                {
                    carouselPage1,
                    carouselPage2,
                    carouselPage3
                },
                Title = "Carousel Page"
            };

            //Set the Main Page to be the Carousel Page with Navigation capabilities
            MainPage = new NavigationPage(mainCarouselPage);
        }
Example #7
0
 static void Update(CarouselPage page)
 {
     Device.StartTimer(TimeSpan.FromSeconds(1), () =>
     {
         page.Children.Remove(page.Children.Skip(1).First() as ContentPage);
         Device.StartTimer(TimeSpan.FromSeconds(1), () =>
         {
             page.Children.Add(new ContentPage
             {
                 BackgroundColor = Colors.Blue,
                 Content         = new Label
                 {
                     Text = "Page Two - Added"
                 }
             });
             page.Children.Add(new ContentPage
             {
                 BackgroundColor = Colors.Gray,
                 Content         = new Label
                 {
                     Text = "Page Three - Added"
                 }
             });
             return(false);
         });
         return(false);
     });
 }
        async Task ProcessNavigationForCarouselPage(CarouselPage currentPage, string nextSegment, Queue <string> segments, NavigationParameters parameters, bool?useModalNavigation, bool animated)
        {
            var nextSegmentType = PageNavigationRegistry.GetPageType(UriParsingHelper.GetSegmentName(nextSegment));

            foreach (var child in currentPage.Children)
            {
                if (child.GetType() != nextSegmentType)
                {
                    continue;
                }

                await ProcessNavigation(child, segments, parameters, useModalNavigation, animated);
                await DoNavigateAction(null, nextSegment, child, parameters, () =>
                {
                    currentPage.CurrentPage = child;
                });

                return;
            }


            var nextPage = CreatePageFromSegment(nextSegment);

            await ProcessNavigation(nextPage, segments, parameters, useModalNavigation, animated);
            await DoNavigateAction(currentPage, nextSegment, nextPage, parameters, async() =>
            {
                await DoPush(currentPage, nextPage, true, animated);
            });
        }
Example #9
0
        protected override void OnStart()
        {
            // Handle when your app starts

            MagazineListView magazineListView = new MagazineListView(navigationController);
            NavigationPage   magazineList     = new NavigationPage(magazineListView)
            {
                BackgroundColor = Color.FromHex("#80000000")
            };

            CarouselPage menuCarousel = new CarouselPage();
            MenuView     menuView     = new MenuView(navigationController);

            menuCarousel.Title = Constants.UNIVERSALIST_DERGI_TITLE;
            menuCarousel.Children.Add(menuView);

            MasterDetailPage masterDetail = new MasterDetailPage()
            {
                Master = menuCarousel,
                Detail = magazineList,
                Title  = Constants.UNIVERSALIST_DERGI_TITLE
            };

            masterDetail.IsPresentedChanged += IsPresentedChanged;
            navigationController.InitializeController(masterDetail, magazineList, menuCarousel);

            MainPage = masterDetail;
        }
Example #10
0
        public App()
        {
            // Create 3 Pages to be included in the main carousel page
            var carouselPage1 = new GatePage("Page 1", 3)
            {
                BackgroundColor = Color.Maroon
            };
            var carouselPage2 = new GatePage("Page 2", 3)
            {
                BackgroundColor = Color.Green
            };
            var carouselPage3 = new GatePage("Page 3", 3)
            {
                BackgroundColor = Color.Fuchsia
            };
            var mainCarouselPage = new CarouselPage
            {
                Children =
                {
                    carouselPage1,
                    carouselPage2,
                    carouselPage3
                },
                Title = "Carousel Page"
            };

            //Set the Main Page to be the Carousel Page with Navigation capabilities
            MainPage = new NavigationPage(mainCarouselPage);
        }
Example #11
0
        public static Page GetMainPage()
        {
            var mainPage = new ExtendedTabbedPage();

            mainPage.CurrentPageChanged +=
                () => Debug.WriteLine(string.Format("ExtendedTabbedPage CurrentPageChanged {0}", mainPage.CurrentPage.Title));

            var controls = new CarouselPage();

            controls.Title = "Controls";
            controls.Children.Add(new CalendarPage());

            var services = new CarouselPage();

            services.Title = "Services";
            services.Children.Add(new TextToSpeechPage());

            var buttons = new CarouselPage();

            buttons.Title = "Buttons";
            buttons.Children.Add(new ButtonPage());

            mainPage.Children.Add(controls);
            mainPage.Children.Add(services);
            mainPage.Children.Add(buttons);

            return(mainPage);
        }
Example #12
0
        private void viewlist_ItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            MDPProperties selected = (MDPProperties)e.SelectedItem;
            CarouselPage  page     = selected.TargetPage;

            Detail = new NavigationPage(page);
        }
Example #13
0
        private void MenuButton_Clicked(object sender, EventArgs e)
        {
            var mp = this.Parent as MasterDetailPage;

            if (sender == homeButton)
            {
                var np = new NavigationPage(new HomePage());
                mp.Detail = np;
            }
            else if (sender == navButton)
            {
                var np = new NavigationPage(new NavPage1());
                mp.Detail = np;
            }

            else if (sender == tabButton)
            {
                var tp = new TabbedPage();
                tp.Children.Add(new TabPage1());
                tp.Children.Add(new TabPage2());
                tp.Children.Add(new TabPage3());

                var np = new NavigationPage(tp);
                mp.Detail = np;
            }
            else if (sender == carouselButton)
            {
                var cp = new CarouselPage();
                cp.Children.Add(new TabPage1());
                cp.Children.Add(new TabPage2());
                cp.Children.Add(new TabPage3());

                var np = new NavigationPage(cp);
                mp.Detail = np;
            }
            else if (sender == contentButton)
            {
                var np = new NavigationPage(new Page1());
                mp.Detail = np;
            }
            else if (sender == preferenceButton)
            {
                var np = new NavigationPage(new PreferencePage());
                mp.Detail = np;
            }

            else if (sender == customerregisterButton)
            {
                var np = new NavigationPage(new CustomerRegisterPage());
                mp.Detail = np;
            }

            else if (sender == customerlistButton)
            {
                var np = new NavigationPage(new CustomerListPage());
                mp.Detail = np;
            }
            mp.IsPresented = false;
        }
		public CarouselPageAdapter(ViewPager pager, CarouselPage page, Context context)
		{
			_pager = pager;
			_page = page;
			_context = context;

			page.PagesChanged += OnPagesChanged;
		}
        public CarouselPageAdapter(ViewPager pager, CarouselPage page, Context context)
        {
            _pager   = pager;
            _page    = page;
            _context = context;

            page.PagesChanged += OnPagesChanged;
        }
Example #16
0
 public void reloadAllPages()
 {
     question     = new PageQuestion(this);
     journalsPage = new JournalsPage(this);
     carousel     = new CarouselPage(this);
     mediaPage    = new PageMedia(this);
     sendPage     = new PageSend(this);
 }
Example #17
0
        public MenuViewModel()
        {
            Items = new ObservableCollection<MenuItem>() {

                new MenuItem() {
                    Title = "Терминал",
                    Command = new PageFactoryCommand(() => {
                        var carouselPage = new CarouselPage ();
                        var categories = App.api.getCategories (App.user);
                        if (categories == null) {
                            categories = new List<Category>();
                        }
                        foreach (var category in categories) {
                            carouselPage.Children.Add (new CategoryPage(category));
                        }
                        App.MasterDetailPage.Detail = carouselPage;
                        App.MasterDetailPage.IsPresented = true;

                    })
                },

                new MenuItem() {
                    Title = "Отчет продаж",
                    Command = new PageFactoryCommand(() => {
                        App.MasterDetailPage.Detail = new SalesReportPage();
                        App.MasterDetailPage.IsPresented = true;

                    })
                },

                new MenuItem() {
                    Title = "Управление товаром",
                    Command = new PageFactoryCommand(() => {
                        App.MasterDetailPage.Detail = new CategoryListEditPage();
                        App.MasterDetailPage.IsPresented = true;

                    })
                },

                new MenuItem() {
                    Title = "Написать нам",
                    Command = new PageFactoryCommand(() => {
                        App.MasterDetailPage.Detail = new ReviewPage();
                        App.MasterDetailPage.IsPresented = true;

                    })
                },

                //new MenuItem() {
                //	Title = "Вход",
                //	Command = new PageFactoryCommand(() =>
                //		PageFactory.GetMessagablePageFromCache<LoginViewViewModel>()
                    //.SendMessageToViewModel("FillWithData")
            //			.PushPage())
            //	},
            };
        }
        void CarouselButton_Clicked(object sender, EventArgs e)
        {
            var mp = Parent as MasterDetailPage;
            var cp = new CarouselPage();

            cp.Children.Add(new TabPage1());
            cp.Children.Add(new TabPage2());
            cp.Children.Add(new TabPage3());
        }
Example #19
0
        void UpdateCurrentPage(bool animated = true)
        {
            ContentPage current = Carousel.CurrentPage;

            if (current != null)
            {
                ScrollToPage(CarouselPage.GetIndex(current), animated);
            }
        }
Example #20
0
        async void BtnCarousePage_Clicked(object sender, EventArgs e)
        {
            CarouselPage carouselPage = new CarouselPage();

            carouselPage.Children.Add(new CarousePageDetail1());
            carouselPage.Children.Add(new CarousePageDetail2());
            carouselPage.Children.Add(new CarousePageDetail3());

            await Navigation.PushAsync(carouselPage);
        }
Example #21
0
        private Page CreateMainPage()
        {
            _slotsPage = new CarouselPage();
            _slotsPage.Children.Add(new ContentPage());  // Android requires a page before being added to tree (this page is removed)

            _nav = new NavigationPage(_slotsPage);
            _nav.BarTextColor = (Color)Resources["ForegroundThemeColor"];

            return(_nav);
        }
Example #22
0
 public ControlsFrame()
 {
     InitializeComponent();
     Carousel     = new CarouselPage();
     SelectedRoom = new Classroom();
     bldgPick.SelectedIndexChanged += BuildingPicker_SelectedIndexChanged;
     bldgPick.Focused   += LoadBuildingPickerData;
     roomPick.Unfocused += RoomPick_Unfocused;
     ControllerGUC       = new AMXController();
 }
Example #23
0
        public IntroCarousel()
        {
            Instance = this;

            this.Children.Add(new IntroPage1());
            this.Children.Add(new IntroPage2());
            this.Children.Add(new IntroPage3());
            this.Children.Add(new IntroPage4());
            this.Children.Add(new IntroPage5());
        }
Example #24
0
        private Page CreateMainPage ()
        {
            _slotsPage = new CarouselPage();
            _slotsPage.Children.Add (new ContentPage()); // Android requires a page before being added to tree (this page is removed)

            _nav = new NavigationPage(_slotsPage);
            _nav.BarTextColor = (Color)Resources["ForegroundThemeColor"];

            return _nav;
        }
Example #25
0
        public void showCarouselPage(bool reload = false)
        {
            if (carousel == null || reload)
            {
                carousel = new CarouselPage(this);
            }

            Content = carousel;
            // carousel.InitializeComponent();
        }
Example #26
0
        protected virtual async Task ProcessNavigationForCarouselPage(CarouselPage currentPage, string nextSegment, Queue <string> segments, INavigationParameters parameters, bool?useModalNavigation, bool animated)
        {
            var nextPage = CreatePageFromSegment(nextSegment);

            await ProcessNavigation(nextPage, segments, parameters, useModalNavigation, animated);
            await DoNavigateAction(currentPage, nextSegment, nextPage, parameters, async() =>
            {
                await DoPush(currentPage, nextPage, useModalNavigation, animated);
            });
        }
Example #27
0
        public App()
        {
            InitializeComponent();

            CarouselPage carouselPage = new CarouselPage();

            carouselPage.Children.Add(new Page1());
            carouselPage.Children.Add(new Page2());
            MainPage = carouselPage;
        }
Example #28
0
        public App()
        {

            LocService = DependencyService.Get<HelperClasses.ILocationProvider>();
            page1 = new OurCrousalPage("CarousalPage1.jpg");
            page2 = new OurCrousalPage("CarousalPage2.jpg");
            page1.btnEntry.IsEnabled = false;
            page2.btnEntry.IsEnabled = false;
            counter = 0;
            carousal = new CarouselPage();
            carousal.Children.Add(page1);
            carousal.Children.Add(page2);

            fileService = DependencyService.Get<ISaveAndLoad>();

            page1.btnEntry.Clicked += delegate
            {

                MainPage = new NavigationPage(new HomePage())
                {
                    BarBackgroundColor = ZadSpecialDesigen.ZadGreenNavBar,
                    BarTextColor = Color.White,
                    Icon = "icon2.png",

                };

                page1 = null;
                page2 = null;
                carousal = null;
            };

            page2.btnEntry.Clicked += delegate
            {

                navigationPage = new NavigationPage(new HomePage())
                {
                    BarBackgroundColor = ZadSpecialDesigen.ZadGreenNavBar,
                    BarTextColor = Color.White,
                    Icon = "icon2.png",
                };
                MainPage = navigationPage;
                page1 = null;
                page2 = null;
                carousal = null;
            };


            MainPage = carousal;
            if (Device.OS == TargetPlatform.iOS)
            {
                var time = TimeSpan.FromSeconds(3);
                Device.StartTimer(time, Swapping);
            }

        }
Example #29
0
        public void SetElement(VisualElement element)
        {
            var newPage = element as CarouselPage;

            if (element != null && newPage == null)
            {
                throw new ArgumentException("element must be a CarouselPage");
            }

            CarouselPage oldPage = Element;

            Element = newPage;

            if (oldPage != null)
            {
                oldPage.SendDisappearing();
                ((INotifyCollectionChanged)oldPage.Children).CollectionChanged -= OnChildrenChanged;
                oldPage.PropertyChanged -= OnElementPropertyChanged;
            }

            if (newPage != null)
            {
                if (_tracker == null)
                {
                    _tracker = new BackgroundTracker <FlipView>(BackgroundProperty)
                    {
                        Control = this, Container = this
                    };
                }

                _tracker.Element = newPage;

                // Adding Items triggers the SelectionChanged event,
                // which will reset the CurrentPage unless we tell it to ignore.
                _fromUpdate = true;
                for (var i = 0; i < newPage.Children.Count; i++)
                {
                    Items.Add(newPage.Children[i]);
                }
                _fromUpdate = false;

                ((INotifyCollectionChanged)newPage.Children).CollectionChanged += OnChildrenChanged;
                newPage.PropertyChanged += OnElementPropertyChanged;

                UpdateCurrentPage();
                newPage.SendAppearing();
            }

            OnElementChanged(new ElementChangedEventArgs <CarouselPage>(oldPage, newPage));

            if (!string.IsNullOrEmpty(Element?.AutomationId))
            {
                SetValue(Windows.UI.Xaml.Automation.AutomationProperties.AutomationIdProperty, Element.AutomationId);
            }
        }
Example #30
0
        public App(PingPage pingPage, PoiPage poiPage)
        {
            InitializeComponent();

            var carouselPage = new CarouselPage();

            carouselPage.Children.Add(poiPage);
            carouselPage.Children.Add(pingPage);

            MainPage = carouselPage;
        }
        private async void OnNavigateToCarouselPageSample(object sender, EventArgs e)
        {
            CarouselPage carouselPage = new CarouselPage {
                Title = "Carousel page"
            };

            carouselPage.Children.Add(new FirstView());
            carouselPage.Children.Add(new SecondView());

            await Navigation.PushAsync(carouselPage);
        }
Example #32
0
        public App()
        {
            InitializeComponent();

            CarouselPage carouselPage = new CarouselPage();

            carouselPage.Children.Add(new ListPage());
            carouselPage.Children.Add(new GroupedListPage());

            MainPage = carouselPage;
        }
Example #33
0
        void ConfigureCarouselPage(CarouselPage carouselPage, string segment)
        {
            foreach (var child in carouselPage.Children)
            {
                PageUtilities.SetAutowireViewModelOnPage(child);
            }

            var parameters = UriParsingHelper.GetSegmentParameters(segment);

            CarouselPageSelectTab(carouselPage, parameters);
        }
Example #34
0
File: App.cs Project: zcccust/Study
 public App()
 {
     List<ContentPage> pgs = new List<ContentPage>();
     pgs.Add(new SwitchPageCS());
     pgs.Add(new SwitchPageXaml());
     var pg = new CarouselPage
     {
         Title = "CS,Xaml",
         Children = {
             pgs[0],pgs[1],
         }
     };
     MainPage = pg;
 }
Example #35
0
        public ReviewPage()
        {
            NavigationPage.SetHasNavigationBar (this, false);
            InitializeComponent ();
            var submit = new Button();
            var text = new Editor ();
            var api = new Api ();
            submit.Text = "Send";
            submit.HorizontalOptions =  LayoutOptions.EndAndExpand;
            submit.Command = new Command(o => {
                api.LeaveReview(App.user, text.Text);
                var carouselPage = new CarouselPage ();
                var categories = App.api.getCategories (App.user);
                if (categories == null) {
                    categories = new List<Category>();
                }
                foreach (var category in categories) {
                    carouselPage.Children.Add (new CategoryPage(category));
                }
                App.MasterDetailPage.Detail.Navigation.PushAsync(new NavigationPage(carouselPage));
                //Navigation.PushAsync (new CategoryPage ());
            });
            this.Padding = new Thickness (0, Device.OnPlatform (0, 0, 0), 0, 0);
            var headerLayout = new StackLayout{
                Children = {
                    new Label{
                        Text = "Написать нам",
                        HorizontalOptions = LayoutOptions.Center;
                        TextColor = Color.White
                    }
                },
                BackgroundColor = Color.FromHex("666666"),
                Padding = new Thickness(10,40,10,0),

            };
            // Set the content for the page.
            this.Content = new StackLayout {
                Children = {
                    headerLayout,
                    new StackLayout{
                        Padding = new Thickness(10,20,10,0),
                        Children = {
                            text,
                            submit
                        }
                    }
                }
            };
        }
		protected override void Dispose ( bool disposing ) {
			if ( disposing && page != null ) {
				foreach ( var element in page.Children ) {
					IVisualElementRenderer renderer = GetRenderer ( element );
					if ( renderer != null ) {
						renderer.ViewGroup.RemoveFromParent ();
						renderer.Dispose ();
						SetRenderer ( element , null );
					}
				}
				page.PagesChanged -= OnPagesChanged;
				page = null;
			}
			base.Dispose ( disposing );
		}
 public CarouselPage CreateAssessmentCarouselPage(DateTime? date = null)
 {
     DateTime dateNotNull = date == null ? DateTime.Today : (DateTime)date;
     CarouselPage assessmentCarouselPage = new CarouselPage() {
         Children = {
                 new AssessmentPage(dateNotNull.AddDays(-1)),
                 new AssessmentPage(dateNotNull),
                 new AssessmentPage(dateNotNull.AddDays(1))
             },
         Title = String.Format("{0} voor {1}",
             LoginController.Instance.GetCurrentUser.Functie == 2 ? "Afspraken" : "Werkopdrachten",
             dateNotNull == DateTime.Today ? "vandaag" : date.ToString())
     };
     assessmentCarouselPage.CurrentPage = assessmentCarouselPage.Children[1];
     return assessmentCarouselPage;
 }
Example #38
0
        void OnDoRegister(object sender, EventArgs e)
        {
            var apiObj = new Api ();

            //var userObj = apiObj.RegisterUser (LoginText.Text, PasswordText.Text, EmailText.Text, PhoneText.Text, FullNameText.Text );
            //App.user = userObj;
            var carouselPage = new CarouselPage ();
            var categories = App.api.getCategories (App.user);
            if (categories == null) {
                categories = new List<Category>();
            }
            foreach (var category in categories) {
                carouselPage.Children.Add (new CategoryPage(category));
            }
            Navigation.PushAsync (carouselPage);
        }
Example #39
0
        public HomePage()
        {
            Padding = new Thickness(10, Device.OnPlatform(20,0,0),10,0);
            Title = "Pages";

            var button1 = new Button() {Text = "Simple Page"};
            button1.Clicked += (o, e) =>
            {
                Navigation.PushAsync(new CoursePage(PluralsightCourse.GetCourseList().First()));
            };

            var button2 = new Button() { Text = "Master/Detail" };
            button2.Clicked += (o, e) => { Navigation.PushAsync(new CourseMasterDetail());};

            var button3 = new Button() { Text = "Master/Detail (binding)" };
            button3.Clicked += (o, e) => { Navigation.PushAsync(new CourseMasterDetailDB()); };

            var button4 = new Button() { Text = "Tabbed" };
            button4.Clicked += (o, e) =>
            {
                var page = new TabbedPage() {Title = "Courses"};
                foreach (var course in PluralsightCourse.GetCourseList())
                {
                    var coursePage = new CoursePageDB();
                    coursePage.BindingContext = course;
                    page.Children.Add(coursePage);
                }
                Navigation.PushAsync(page);
            };

            var button5 = new Button() { Text = "Carousel" };
            button5.Clicked += (o, e) =>
            {
                var page = new CarouselPage();
                {
                    Title = "Courses";
                };
                foreach (var coursePage in PluralsightCourse.GetCourseList().Select(course => new CoursePageDB {BindingContext = course}))
                {
                    page.Children.Add(coursePage);
                }
                Navigation.PushAsync(page);
            };

            Content = new StackLayout() {Spacing = 10, Children = { button1,button2,button3,button4,button5}};

        }
		public AppearingGalleryPage ()
		{
			var initalPage = new AppearingPage (1);
			var initalPage2 = new AppearingPage (2);

			Content = new StackLayout { 
				Children = {
					new Button { Text = NavPageTitle, Command = new Command (() => {
						Application.Current.MainPage = new NavAppearingPage(initalPage);
						}) 
					},
					new Button { Text = MasterPageTitle, Command = new Command (() => {
						var page = new MasterDetailPage {
							Title = MasterPageTitle,
							Master = new ContentPage { Title = "Master", BackgroundColor = Color.Red },
							Detail =  new NavAppearingPage(initalPage)
						};
						SetMainPage (page);
					})
					},
					new Button { Text = TabbedPageTitle, Command = new Command (() => {
						var page = new TabbedPage {
							Title = TabbedPageTitle,
							Children = { initalPage, initalPage2 }
						};
						SetMainPage (page);
					})
					},
					new Button { Text =  CarouselPageTitle, Command = new Command (() => {
						
						var page = new CarouselPage {
							Title = CarouselPageTitle,
							Children = { initalPage, initalPage2 }
						};
						SetMainPage (page);
					})
					}	
				}
			};
		}
Example #41
0
        public static Page GetMainPage()
        {
            var mainPage = new ExtendedTabbedPage ();
            mainPage.CurrentPageChanged +=
                () => Debug.WriteLine(string.Format("ExtendedTabbedPage CurrentPageChanged {0}",mainPage.CurrentPage.Title));

            var controls = new CarouselPage ();
            controls.Title = "Controls";
            controls.Children.Add (new CalendarPage ());

            var services = new CarouselPage ();
            services.Title = "Services";
            services.Children.Add (new TextToSpeechPage ());

            var buttons = new CarouselPage ();
            buttons.Title = "Buttons";
            buttons.Children.Add (new ButtonPage ());

            mainPage.Children.Add (controls);
            mainPage.Children.Add (services);
            mainPage.Children.Add (buttons);

            return mainPage;
        }
Example #42
0
        protected virtual async Task ProcessNavigationForCarouselPage(CarouselPage currentPage, string nextSegment, Queue<string> segments, NavigationParameters parameters, bool? useModalNavigation, bool animated)
        {
            var nextSegmentType = PageNavigationRegistry.GetPageType(UriParsingHelper.GetSegmentName(nextSegment));
            foreach (var child in currentPage.Children)
            {
                if (child.GetType() != nextSegmentType)
                    continue;

                await ProcessNavigation(child, segments, parameters, useModalNavigation, animated);
                await DoNavigateAction(null, nextSegment, child, parameters, onNavigationActionCompleted: () =>
                {
                    currentPage.CurrentPage = child;
                });
                return;
            }

            var nextPage = CreatePageFromSegment(nextSegment);
            await ProcessNavigation(nextPage, segments, parameters, useModalNavigation, animated);
            await DoNavigateAction(currentPage, nextSegment, nextPage, parameters, async () =>
            {
                await DoPush(currentPage, nextPage, useModalNavigation, animated);
            });
        }
		public TabCarouselPageAdapter ( ViewPager pager , CarouselPage page , Context context ) {
			this.pager = pager;
			this.page = page;
			this.context = context;
			page.PagesChanged += OnPagesChanged;
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && _page != null)
			{
				foreach (Element element in _page.LogicalChildren)
				{
					var childPage = element as VisualElement;

					if (childPage == null)
						continue;

					IVisualElementRenderer childPageRenderer = Platform.GetRenderer(childPage);
					if (childPageRenderer != null)
					{
						childPageRenderer.ViewGroup.RemoveFromParent();
						childPageRenderer.Dispose();
						Platform.SetRenderer(childPage, null);
					}
				}
				_page.PagesChanged -= OnPagesChanged;
				_page = null;
			}
			base.Dispose(disposing);
		}
 public static FluentCarouselPage CarouselPage(CarouselPage instance = null)
 {
     return new FluentCarouselPage (instance);
 }
 public TabCarouselPageIndicator ( Context context , CarouselPage element , IAttributeSet attrs )
         : base ( context , attrs ) {
     this.element = element;
 }
Example #47
0
		public static NavigationPage FetchMainUI ()
		{
			var momentsPage = new MomentsPage ();
			var cameraPage = new CameraPage ();
			var friendsPage = new FriendsPage ();
			var profilePage = new ProfilePage ();

			var carouselPage = new CarouselPage {
				Children = {
					momentsPage,
					cameraPage,
					friendsPage,
					profilePage
				},
				CurrentPage = momentsPage
			};

			var navigationPage = new NavigationPage (carouselPage) {
				BarBackgroundColor = Colors.NavigationBarColor,
				BarTextColor = Colors.NavigationBarTextColor
			};

			if (Device.OS != TargetPlatform.Android) {
				NavigationPage.SetHasNavigationBar (carouselPage, false);
				carouselPage.CurrentPage = cameraPage;
			} else {
				carouselPage.Title = "Friends";
				carouselPage.CurrentPage = friendsPage;
			}

			carouselPage.PropertyChanged += (object sender, PropertyChangedEventArgs e) => {
				if (e.PropertyName == "CurrentPage") {
					var currentPageType = carouselPage.CurrentPage.GetType ();

					if (currentPageType == typeof (MomentsPage)) {
						NavigationPage.SetHasNavigationBar (carouselPage, true);
						carouselPage.Title = "Moments";
					} else if (currentPageType == typeof (CameraPage)) {
						NavigationPage.SetHasNavigationBar (carouselPage, false);
						carouselPage.Title = "Camera";
					} else if (currentPageType == typeof (ProfilePage)) {
						NavigationPage.SetHasNavigationBar (carouselPage, true);
						carouselPage.Title = "Profile";
					} else {
						NavigationPage.SetHasNavigationBar (carouselPage, true);
						carouselPage.Title = "Friends";
					}
				}
			};

			carouselPage.CurrentPageChanged += (object sender, EventArgs e) => {
				var currentPage = carouselPage.CurrentPage as BasePage;
				if (carouselPage.CurrentPage.GetType () == typeof (FriendsPage) && Device.OS == TargetPlatform.iOS) {
					currentPage.LeftToolbarItems.Add (new ToolbarItem {
						Icon = "FriendRequestsButton.png",
						Command = new Command (() => currentPage.Navigation.PushModalAsync (new NavigationPage (new FriendRequestsPage ()) {
							BarBackgroundColor = Colors.NavigationBarColor,
							BarTextColor = Colors.NavigationBarTextColor
						}, true)),
						Priority = 1
					});
				} else {
					currentPage.LeftToolbarItems.Clear ();
				}
			};

			return navigationPage;
		}
 public TabCarouselPageIndicator ( Context context , CarouselPage element )
         : base ( context ) {
     this.element = element;
 }
Example #49
0
		protected override void Init ()
		{
			s_mdp = this;
			
			var lblCount = new Label { AutomationId = "lblCount" };

			var myCarouselPage = new CarouselPage () {

				Children = {
					new ContentPage { 
						BackgroundColor = Color.Green,
						Content = new StackLayout {
							Children = {
								new Button { 
									AutomationId = "ShowMasterBtnPage1", 
									Text = "ShowMaster",
									Command = new Command(()=> s_mdp.IsPresented = true)
								},
								lblCount
							}
						}
					},
					new ContentPage { 
						BackgroundColor = Color.Red
					},
					new ContentPage { 
						BackgroundColor = Color.Lime,
					},
					new ContentPage { 
						BackgroundColor = Color.Purple,
					},
				}
			};

			var myCarouselDetailPage = new NavigationPage (myCarouselPage);

			var myPushButton = new Button () {
				Text = "Push Page", 
				HorizontalOptions = LayoutOptions.Start
			}; 

			myCarouselPage.Appearing += (sender, e) => {
				_countAppearing++;
				lblCount.Text = _countAppearing.ToString ();
			};
			myCarouselPage.Disappearing += (sender, e) => {
				_countAppearing--;
			};


			var mySecondDetailPage = new NavigationPage (new ContentPage () { 
				Title = "My Second Page", 

				Content = new StackLayout () {
					Orientation = StackOrientation.Vertical,
					Children = {
						new Button { 
							AutomationId = "ShowMasterBtnPage2", 
							Text = "ShowMaster",
							Command = new Command(()=> s_mdp.IsPresented = true)
						},
						myPushButton
					}
				}
			});

			myPushButton.Command = new Command (() => mySecondDetailPage.Navigation.PushAsync (new ContentPage () { Title = "My Pushed Page" }));

			var myMasterPage = new ContentPage () {
				Padding = new Thickness (0, 60, 0, 0),
				Title = "Menu",
				Content = new StackLayout () {
					Orientation = StackOrientation.Vertical,
					Children = {
						new Button () {
							Text = "Detail 1",
							AutomationId = "btnDetail1",
							Command = new Command (() => {
								Detail = myCarouselDetailPage;
								IsPresented = false;
							}),
							HorizontalOptions = LayoutOptions.Start
						},

						new Button () {
							Text = "Detail 2",
							AutomationId = "btnDetail2",
							Command = new Command (() => {
								Detail = mySecondDetailPage;
								IsPresented = false;
							}),
							HorizontalOptions = LayoutOptions.Start
						}

					}
				}
			};

			Master = myMasterPage;
			Detail = myCarouselDetailPage;
		}