protected override void OnSizeAllocated(double width, double height)
        {
            base.OnSizeAllocated(width, height);

            if (width < 10)
            {
                return;
            }

            MainGrid.Padding           = new Thickness(0);
            MainListView.ItemWidth     = (int)((width * 0.90) / 3d);
            MainListView.ItemHeight    = (int)(MainListView.ItemWidth * 1.40d);
            MainListView.WidthRequest  = width * 0.90; //90% of the width.
            MainListView.HeightRequest = (MainListView.ItemHeight + MainListView.ItemSpacing) * 2;

            var req  = MainListView.Measure(double.PositiveInfinity, double.PositiveInfinity);
            var req2 = MainGrid.Measure(double.PositiveInfinity, double.NegativeInfinity);

            var widthAvailable  = width - req2.Request.Width;
            var heightAvailable = height - req2.Request.Height - PhotosLabel.Height - PhotosLabel.Margin.VerticalThickness;

            MainGrid.Padding = new Thickness(widthAvailable / 2d, heightAvailable / 2d, widthAvailable / 2d, heightAvailable / 2d);
        }