Exemplo n.º 1
0
        View CreateDayRow()
        {
            var carousel = new CarouselLayout {
                HeightRequest = 40,
                ItemTemplate  = new DataTemplate(typeof(DayHeader))
            };

            carousel.SetBinding(CarouselLayout.ItemsSourceProperty, "AgendaDays", BindingMode.OneWay);
            carousel.SetBinding(CarouselLayout.SelectedItemProperty, "SelectedDay", BindingMode.TwoWay);
            return(carousel);
        }
        View CreateDayRow()
        {
            var carousel = new CarouselLayout {
                HeightRequest = 40,
                ItemTemplate  = new DataTemplate(typeof(DayHeader))
            };

            carousel.SetBinding(CarouselLayout.ItemsSourceProperty, "FullScheduleDays");
            carousel.SetBinding(CarouselLayout.SelectedItemProperty, "SelectedDay");
            return(carousel);
        }
        CarouselLayout CreatePagesCarousel()
        {
            var carousel = new CarouselLayout {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                IndicatorStyle    = _indicatorStyle,
                ItemTemplate      = new DataTemplate(typeof(HomeView))
            };

            carousel.SetBinding(CarouselLayout.ItemsSourceProperty, "Pages");
            carousel.SetBinding(CarouselLayout.SelectedItemProperty, "CurrentPage", BindingMode.TwoWay);

            return(carousel);
        }
        CarouselLayout CreatePagesCarousel()
        {
            var carousel = new CarouselLayout
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.FillAndExpand,
                IndicatorStyle = _indicatorStyle,
                ItemTemplate = new DataTemplate(typeof(DynamicTemplateLayout))
            };
            carousel.SetBinding(CarouselLayout.ItemsSourceProperty, "Pages");
            carousel.SetBinding(CarouselLayout.SelectedItemProperty, "CurrentPage", BindingMode.TwoWay);

            return carousel;
        }
Exemplo n.º 5
0
        CarouselLayout CreateSessionInfoCarousel()
        {
            var carousel = new CarouselLayout
            {
                ItemTemplate      = new DataTemplate(typeof(SessionInfoView)),
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand
            };

            carousel.SetBinding(CarouselLayout.ItemsSourceProperty, "SlotSessions");
            carousel.SetBinding(CarouselLayout.SelectedItemProperty, "SlotSession");

            return(carousel);
        }
Exemplo n.º 6
0
        View CreateCurrentSessionsCarousel()
        {
            var carousel = new CarouselLayout
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                ItemTemplate      = new DataTemplate(typeof(HomeCurrentSessionView))
            };

            carousel.SetBinding(CarouselLayout.ItemsSourceProperty, "CurrentSessions");
            carousel.SetBinding(CarouselLayout.SelectedItemProperty, "CurrentSession");

            return(carousel);
        }
Exemplo n.º 7
0
        /// <summary>
        /// Set layout bindings and other default values
        /// </summary>
        private void InitializeLayout(CarouselLayout layout)
        {
            layout.HorizontalOptions        = LayoutOptions.Fill;
            layout.VerticalOptions          = LayoutOptions.Fill;
            layout.PanChanged              += OnPanChanged;
            layout.CurrentItemIndexChanged += OnCurrentItemIndexChanged;
            layout.ScrollEnded             += OnScrollEnded;
            layout.IsDebugEnabled           = IsDebugEnabled;

            Binding bind = new Binding(CarouselView.IsFlipEnabledProperty.PropertyName);

            bind.Source = this;
            layout.SetBinding(CarouselLayout.IsFlipEnabledProperty, bind);

            bind        = new Binding(CarouselView.IsPanEnabledProperty.PropertyName);
            bind.Source = this;
            layout.SetBinding(CarouselLayout.IsPanEnabledProperty, bind);

            bind        = new Binding(CarouselView.SnapPointsTypeProperty.PropertyName);
            bind.Source = this;
            layout.SetBinding(CarouselLayout.SnapPointsTypeProperty, bind);

            bind        = new Binding(CarouselView.CurrentItemIndexProperty.PropertyName);
            bind.Source = this;
            bind.Mode   = BindingMode.TwoWay;
            layout.SetBinding(CarouselLayout.CurrentItemIndexProperty, bind);

            bind        = new Binding(CarouselView.SnapPointsAlignmentProperty.PropertyName);
            bind.Source = this;
            bind.Mode   = BindingMode.TwoWay;
            layout.SetBinding(CarouselLayout.SnapPointsAlignmentProperty, bind);

            bind        = new Binding(CarouselView.ScrollEndedCommandProperty.PropertyName);
            bind.Source = this;
            bind.Mode   = BindingMode.TwoWay;
            layout.SetBinding(CarouselLayout.ScrollEndedCommandProperty, bind);
        }