Esempio n. 1
0
        public void CarouselImages_Scrolled(object sender, CarouselView.FormsPlugin.Abstractions.ScrolledEventArgs e)
        {
            var    DirectionSwiped  = (e.Direction).ToString();
            double NewCarouselValue = e.NewValue;

            //var vm = new ShowGuitarModelViewModel(null, null);
        }
        private void OnScrolled(object sender, ScrolledEventArgs e)
        {
            _isTransitioning = false;
            if (e.NewValue < 100 && e.NewValue > Math.Abs(ScrollProgress) * 100)
            {
                _isInverseScrolling = e.Direction == ScrollDirection.Up || e.Direction == ScrollDirection.Left;
            }

            HandleScroll(e.NewValue, _isInverseScrolling);
        }
Esempio n. 3
0
        public void Handle_Scrolled(object sender, CarouselView.FormsPlugin.Abstractions.ScrolledEventArgs e)
        {
            int position = 0;

            if (e.Direction == ScrollDirection.Right)
            {
                position = (int)((_currentIndex * 100) + e.NewValue);
            }
            else if (e.Direction == ScrollDirection.Left)
            {
                position = (int)((_currentIndex * 100) - e.NewValue);
            }

            // Set the background color of our page to the item in the color gradient
            // array, matching the current scrollindex.
            if (position > _backgroundColors.Count - 1)
            {
                page.BackgroundColor = _backgroundColors.Last();
            }
            else if (position < 0)
            {
                page.BackgroundColor = _backgroundColors.First();
            }
            else
            {
                page.BackgroundColor = _backgroundColors[position];
            }

            // Save the current scroll position
            Wrapper.SlidePosition = e.NewValue;

            if (e.Direction == ScrollDirection.Right)
            {
                // When scrolling right, we offset the current item and the next one.
                Wrapper.Items[_currentIndex].Position = -Wrapper.SlidePosition;

                if (_currentIndex < Wrapper.Items.Count - 1)
                {
                    Wrapper.Items[_currentIndex + 1].Position = 100 - Wrapper.SlidePosition;
                }
            }
            else if (e.Direction == ScrollDirection.Left)
            {
                // When scrolling left, we offset the current item and the previous one.
                Wrapper.Items[_currentIndex].Position = Wrapper.SlidePosition;

                if (_currentIndex > 0)
                {
                    Wrapper.Items[_currentIndex - 1].Position = -100 + Wrapper.SlidePosition;
                }
            }
        }
Esempio n. 4
0
        public void Handle_Scrolled(object sender, CarouselView.FormsPlugin.Abstractions.ScrolledEventArgs e)
        {
            int position = 0;

            if (e.Direction == ScrollDirection.Right)
            {
                position = (int)((this._currentIndex * 100) + e.NewValue);
            }
            else if (e.Direction == ScrollDirection.Left)
            {
                position = (int)((this._currentIndex * 100) - e.NewValue);
            }

            if (position > this._backgroundColors.Count - 1)
            {
                this.page.BackgroundColor = this._backgroundColors.Last();
            }
            else if (position < 0)
            {
                this.page.BackgroundColor = this._backgroundColors.First();
            }
            else
            {
                this.page.BackgroundColor = this._backgroundColors[position];
            }

            this.Wrapper.SlidePosition = e.NewValue;

            if (e.Direction == ScrollDirection.Right)
            {
                this.Wrapper.Items[this._currentIndex].Position = -this.Wrapper.SlidePosition;

                if (this._currentIndex < this.Wrapper.Items.Count - 1)
                {
                    this.Wrapper.Items[this._currentIndex + 1].Position = 100 - this.Wrapper.SlidePosition;
                }
            }
            else if (e.Direction == ScrollDirection.Left)
            {
                this.Wrapper.Items[_currentIndex].Position = this.Wrapper.SlidePosition;

                if (this._currentIndex > 0)
                {
                    this.Wrapper.Items[_currentIndex - 1].Position = -100 + this.Wrapper.SlidePosition;
                }
            }
        }
Esempio n. 5
0
 private void CarouselViewControlOnScrolled(object sender, ScrolledEventArgs e)
 {
     if (_isActive)
     {
         // Hide active slide
         ImageSlide.FadeTo((100 - e.NewValue) / 100);
         ImageSlide.RotateTo((100 - e.NewValue) / 100 * 360);
         ImageSlide.ScaleTo((100 - e.NewValue) / 100);
     }
     else
     {
         // Show slide if it's not active
         ImageSlide.FadeTo(e.NewValue / 100);
         ImageSlide.RotateTo(e.NewValue / 100 * 360);
         ImageSlide.ScaleTo(e.NewValue / 100);
     }
 }
 private void CarouselViewControl_Scrolled(object sender, CarouselView.FormsPlugin.Abstractions.ScrolledEventArgs e)
 {
 }
Esempio n. 7
0
 /// <summary>
 /// control the carocel page scrolling
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void Handle_Scrolled(object sender, CarouselView.FormsPlugin.Abstractions.ScrolledEventArgs e)
 {
     //todo
 }
Esempio n. 8
0
 private void Carousel_OnScrolled(object sender, ScrolledEventArgs e)
 {
     Debug.WriteLine("Scrolled to " + e.NewValue + " percent.");
     Debug.WriteLine("Direction = " + e.Direction);
 }
 void Handle_Scrolled(object sender, CarouselView.FormsPlugin.Abstractions.ScrolledEventArgs e)
 {
     Debug.WriteLine("Scrolled to " + e.NewValue + " position.");
     Debug.WriteLine("Direction = " + e.Direction);
 }