private void BuildControls()
        {
            BackgroundColor = Color.Black;

            var grid = new Grid
            {
                VerticalOptions = LayoutOptions.Fill,
                HorizontalOptions = LayoutOptions.Fill,
            };

            grid.AddAutoRowDefinition();
            grid.AddStarRowDefinition();
            grid.AddAutoRowDefinition();
            grid.AddAutoRowDefinition();
            grid.AddAutoRowDefinition();
            grid.AddStarColumnDefinition();

            var doneButton = new Button
            {
                VerticalOptions = LayoutOptions.Fill,
                HorizontalOptions = LayoutOptions.End,
                TextColor = Color.White,
                Text = "Done"
            };

            doneButton.SetBinding(Button.CommandProperty, new Binding("CloseCommand"));

            var doneButtonContentView = new ContentView
            {
                Padding = new Thickness(0, 0, 20, 0),
                Content = doneButton
            };

            var image = new ExtendedImage
            {
                Aspect = Aspect.AspectFit
            };

            image.SetBinding(Image.SourceProperty, new Binding("ImageSource"));
            var imageContentView = new ContentView
            {
                Padding = new Thickness(10, 0, 10, 0),
                Content = image
            };

            var titleLabel = new ExtendedLabel
            {
                HorizontalOptions = LayoutOptions.Center,
                TextColor = Color.White,
                XAlign = TextAlignment.Center,
                LineBreakMode = LineBreakMode.NoWrap,
                AdjustFontSizeToFitWidth = true
            };

            titleLabel.SetBinding(Label.TextProperty, new Binding("ImageTitleText"));

            var textLabel = new ExtendedLabel
            {
                HorizontalOptions = LayoutOptions.Center,
                TextColor = Color.White,
                XAlign = TextAlignment.Center,
                LineBreakMode = LineBreakMode.WordWrap,
				FontSize = Font.SystemFontOfSize(NamedSize.Small).FontSize
            };

            textLabel.SetBinding(Label.TextProperty, new Binding("ImageText"));

            var toolBar = new ToolBar
            {
                Translucent = true,
                BarStyle = BarStyle.Dark
            };

            toolBar.ToolBarButtons.Add(new ToolBarButton { SystemButtonItem = SystemButtonItem.FlexibleSpace });

            var shareButton = new ToolBarButton
            {
                ImageSource = ImageSource.FromFile("Images/imageviewerpageupload.png")
            };
            shareButton.SetBinding(ToolBarButton.CommandProperty, "ShareImageCommand");

            toolBar.ToolBarButtons.Add(shareButton);

            Grid.SetRow(doneButtonContentView, 0);
            Grid.SetRow(imageContentView, 1);
            Grid.SetRow(titleLabel, 2);
            Grid.SetRow(textLabel, 3);
            Grid.SetRow(toolBar, 4);

            grid.Children.Add(doneButtonContentView);
            grid.Children.Add(imageContentView);
            grid.Children.Add(titleLabel);
            grid.Children.Add(textLabel);
            grid.Children.Add(toolBar);
            
            Content = grid;
        }
        protected BaseContentPage()
        {
            _contentView = new ContentView
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions = LayoutOptions.Fill
            };

            _backgroundImage = new Image
            {
                Source = BackgroundImageSource,
                Opacity = BackgroundImageOpacity,
                Aspect = BackgroundImageAspect
            };

            _opacityGrid = CreateFillGrid();
            _opacityGrid.IsVisible = false;
            _opacityGrid.Opacity = 0.75;
            _opacityGrid.BackgroundColor = OpacityBackgroundColor;

            var activityGrid = new Grid
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Center,
            };

            activityGrid.AddAutoRowDefinition();
            activityGrid.AddAutoRowDefinition();
            activityGrid.AddAutoColumnDefinition();
            
            _activityIndicator = new ActivityIndicator
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.FillAndExpand,
                Color = Color.White
            };

            _activityLabel = new Label
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Center,
                TextColor = Color.White,
                LineBreakMode = LineBreakMode.WordWrap
            };

            Grid.SetRow(_activityIndicator, 0);
            Grid.SetRow(_activityLabel, 1);

            activityGrid.Children.Add(_activityIndicator);
            activityGrid.Children.Add(_activityLabel);

            _activityFrame = new Frame
            {
                BackgroundColor = BusyIndicatorBackgroundColor,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Center,
                Content = activityGrid,
                IsVisible = false
            };

            _seperator = new ProgressBar
            {
                VerticalOptions = LayoutOptions.Fill,
                IsVisible = ShowSeperator
            };

            _mainGrid = new Grid
            {
                HorizontalOptions = LayoutOptions.Fill,
                VerticalOptions = LayoutOptions.Fill,
                RowSpacing = 0
            };

            _mainGrid.AddStarColumnDefinition();
            _mainGrid.AddAutoRowDefinition();
            _mainGrid.AddStarRowDefinition();

            _mainGrid.Children.Add(_backgroundImage);
            _mainGrid.Children.Add(_contentView);
            _mainGrid.Children.Add(_opacityGrid);
            _mainGrid.Children.Add(_activityFrame);
            _mainGrid.Children.Add(_seperator);
            
            Grid.SetRow(_contentView, 1);
            Grid.SetRow(_opacityGrid, 1);
            Grid.SetRow(_activityFrame, 1);
            Grid.SetRow(_backgroundImage, 1);
            Grid.SetRow(_seperator, 0);
            
            Content = _mainGrid;
            _mainGrid.IsVisible = false;
            Padding = new Thickness(0, Device.OnPlatform(20, 0, 0), 0, 0);
        }