コード例 #1
0
        CarouselLayout CreatePagesCarousel()
        {
            var carousel = new CarouselLayout
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                IndicatorStyle    = CarouselLayout.IndicatorStyleEnum.Tabs,
                ItemTemplate      = new DataTemplate(typeof(HomeView))
            };

            carousel.SetBinding(CarouselLayout.ItemsSourceProperty, "Pages");
            carousel.SetBinding(CarouselLayout.SelectedItemProperty, "CurrentPage", BindingMode.TwoWay);
            return(carousel);
        }
コード例 #2
0
        CarouselLayout CreatePagesCarousel()
        {
            var carousel = new CarouselLayout
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                IndicatorStyle    = CarouselLayout.IndicatorStyleEnum.Tabs,
                ItemTemplate      = new DataTemplate(typeof(HomeView)),
                SelectedIndex     = Index_For_Profile_Page()
            };

            carousel.SetBinding(CarouselLayout.ItemsSourceProperty, "Pages");
            carousel.SetBinding(CarouselLayout.SelectedItemProperty, "CurrentPage", BindingMode.TwoWay);
            System.Diagnostics.Debug.WriteLine("Selected page: " + Index_For_Profile_Page());
            return(carousel);
        }