Paint.HomeScreen.PositionScrollViewContent C# (CSharp) Method

PositionScrollViewContent() private method

Sets the scroll view ContentSize to be the correct size along with all the images inside it.
private PositionScrollViewContent ( ) : void
return void
        private void PositionScrollViewContent()
        {
            int count = 0;
            foreach (var imageView in this.imageViewList)
            {
                imageView.Frame = new System.Drawing.RectangleF(count * this.scrollView.Frame.Width, 0, this.scrollView.Frame.Width, this.scrollView.Frame.Height);
                imageView.ContentMode = UIViewContentMode.ScaleAspectFit;
                count++;
            }

            this.scrollView.ContentSize = new SizeF(this.scrollView.Frame.Width * this.imageViewList.Length, this.scrollView.Frame.Height);

            // As soon as the user scrolls half way through the end image then we will reload the next image
            // [Note: We are comparing the x co-ord (left edge of the image) therefore it is only 'half a frame
            // when scrolling left, but a 'frame and a half when scrolling right'
            this.maxForwardScroll = (this.scrollView.Frame.Width * (imageViewList.Length - 1)) - (this.scrollView.Frame.Width / 2);
            this.minBackwardScroll = this.scrollView.Frame.Width / 2;

            // start in the middle of the screen
            this.scrollView.SetContentOffset(new PointF(this.imageViewList[1].Frame.X, 0), false);
        }