Пример #1
0
        /// <summary>
        /// Views the did load.
        /// </summary>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.NavigationController.SetNavigationBarHidden(true, false);

            _buttons = new List <ImageButton>();

            Title = "Home";

            var mainView = new UIView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
            };

            var buttonView = new UIView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
            };

            Add(mainView);

            /* ----- image views ----- */

            _locationView = new LocationView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
            };

            var logoImageView = new UIImageView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                ContentMode = UIViewContentMode.ScaleAspectFit,
                Image       = UIImage.FromFile("logo.png"),
            };

            var bottomImageView = new UIImageView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                ContentMode = UIViewContentMode.ScaleAspectFill,
                Image       = UIImage.FromFile("bg-bottom.jpg"),
            };

            var transparentBackgroundView = new UIView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                BackgroundColor = UIColor.Black,
                Alpha           = 0.05f
            };

            _progressView = new UIActivityIndicatorView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Color = UIColor.Black,
            };

            _screenSaverView = new UIView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Alpha  = 0.0f,
                Hidden = false
            };

            var screenSaverTapGesture = new UITapGestureRecognizer(() =>
            {
                _screenSaverView.Alpha  = 0.0f;
                _screenSaverView.Hidden = true;
                _screenSaverShowing     = false;

                ViewModel.ResetActions();
            });

            _screenSaverView.AddGestureRecognizer(screenSaverTapGesture);

            mainView.Add(_locationView);
            mainView.Add(_progressView);
            mainView.Add(logoImageView);

            mainView.Add(buttonView);

            buttonView.Add(bottomImageView);
            buttonView.Add(transparentBackgroundView);

            mainView.Add(_screenSaverView);

            /* ----- image views ----- */

            /* ----- buttons ----- */

            var buttonViews = new DictionaryViews()
            {
                { "bottomImageView", bottomImageView },
                { "transparentBackgroundView", transparentBackgroundView },
            };

            for (int i = 0; i < _buttonTitles.Length; i++)
            {
                var button = new ImageButton()
                {
                    TranslatesAutoresizingMaskIntoConstraints = false,
                };

                var title = _buttonTitles[i];

                StyleButton(button, _buttonImagePaths[i], _buttonTitles[i]);
                buttonViews.Add(title.ToLower() + "Button", button);
                buttonView.Add(button);
                // add to button list so we can perform flips
                _buttons.Add(button);
            }

            /* ----- buttons ----- */

            var views = new DictionaryViews()
            {
                { "mainView", mainView },
            };

            var mainViews = new DictionaryViews()
            {
                { "locationView", _locationView },
                { "progressView", _progressView },
                { "logoImageView", logoImageView },
                { "buttonView", buttonView },
                { "screenSaverView", _screenSaverView },
            };

            View.AddConstraints(
                NSLayoutConstraint.FromVisualFormat("V:|[mainView]|", NSLayoutFormatOptions.DirectionLeftToRight, null, views)
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|[mainView]|", NSLayoutFormatOptions.AlignAllTop, null, views))
                .ToArray());

            mainView.AddConstraints(
                NSLayoutConstraint.FromVisualFormat("V:|[locationView][logoImageView][buttonView]|", NSLayoutFormatOptions.DirectionLeftToRight, null, mainViews)
                .Concat(NSLayoutConstraint.FromVisualFormat("V:|[progressView][logoImageView][buttonView]|", NSLayoutFormatOptions.DirectionLeftToRight, null, mainViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("V:|[screenSaverView]|", NSLayoutFormatOptions.DirectionLeftToRight, null, mainViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|[screenSaverView]|", NSLayoutFormatOptions.AlignAllTop, null, mainViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|[progressView]|", NSLayoutFormatOptions.AlignAllTop, null, mainViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|[locationView]|", NSLayoutFormatOptions.AlignAllTop, null, mainViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|[buttonView]|", NSLayoutFormatOptions.AlignAllTop, null, mainViews))
                .Concat(new[] { NSLayoutConstraint.Create(buttonView, NSLayoutAttribute.Height, NSLayoutRelation.Equal, _locationView, NSLayoutAttribute.Height, 0.8f, 0) })
                .Concat(new[] { NSLayoutConstraint.Create(logoImageView, NSLayoutAttribute.Width, NSLayoutRelation.Equal, mainView, NSLayoutAttribute.Width, 0.3f, 0) })
                // height is proportional to width
                .Concat(new[] { NSLayoutConstraint.Create(logoImageView, NSLayoutAttribute.Height, NSLayoutRelation.Equal, logoImageView, NSLayoutAttribute.Width, 1f, 0) })
                .Concat(new[] { NSLayoutConstraint.Create(logoImageView, NSLayoutAttribute.CenterX, NSLayoutRelation.Equal, mainView, NSLayoutAttribute.CenterX, 1f, 0) })
                .ToArray());

            buttonView.AddConstraints(
                NSLayoutConstraint.FromVisualFormat("V:|[bottomImageView]|", NSLayoutFormatOptions.DirectionLeftToRight, null, buttonViews)
                .Concat(NSLayoutConstraint.FromVisualFormat("V:|[transparentBackgroundView]|", NSLayoutFormatOptions.DirectionLeftToRight, null, buttonViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("V:|-1-[searchButton]-1-[blogButton(searchButton)]-1-|", NSLayoutFormatOptions.DirectionLeftToRight, null, buttonViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("V:|-1-[ratesButton]-1-[settingsButton(ratesButton)]-1-|", NSLayoutFormatOptions.DirectionLeftToRight, null, buttonViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("V:|-1-[feedbackButton]-1-[shareButton(feedbackButton)]-1-|", NSLayoutFormatOptions.DirectionLeftToRight, null, buttonViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|[bottomImageView]|", NSLayoutFormatOptions.AlignAllTop, null, buttonViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|[transparentBackgroundView]|", NSLayoutFormatOptions.AlignAllTop, null, buttonViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|-1-[searchButton]-1-[ratesButton(searchButton)]-1-[feedbackButton(searchButton)]-1-|", NSLayoutFormatOptions.AlignAllTop, null, buttonViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|-1-[blogButton]-1-[settingsButton(blogButton)]-1-[shareButton(blogButton)]-1-|", NSLayoutFormatOptions.AlignAllTop, null, buttonViews))
                .ToArray());

            // search button
            this.BindCommand(ViewModel, x => x.SearchCommand, x => x._buttons[0]);

            this.WhenActivated(d =>
            {
                // HACK: Clean this up with proper navigation
                ViewModel.OnShow(new Dictionary <string, object>());
            });
        }
Пример #2
0
        /// <summary>
        /// Views the did load.
        /// </summary>
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.StyleNavigationBar();
            this.NavigationController.SetNavigationBarHidden(false, true);

            _mapView = new MKMapView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                OverlayRenderer = (mapView, overlay) =>
                {
                    if (overlay is MKPolyline)
                    {
                        var route    = (MKPolyline)overlay;
                        var renderer = new MKPolylineRenderer(route)
                        {
                            StrokeColor = UIColor.Blue, Alpha = 0.5f
                        };

                        return(renderer);
                    }

                    return(null);
                }
            };

            /* -- directions panel view -- */

            var directionView = new UIView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
            };

            var directionTopView = new UIView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                BackgroundColor = UIColor.White
            };

            var directionBottomView = new UIView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                BackgroundColor = UIColor.White
            };

            directionView.Add(directionTopView);
            directionView.Add(directionBottomView);

            var directionViews = new DictionaryViews()
            {
                { "directionTopView", directionTopView },
                { "directionBottomView", directionBottomView },
            };

            directionView.AddConstraints(
                NSLayoutConstraint.FromVisualFormat("V:|[directionTopView(40)][directionBottomView]|", NSLayoutFormatOptions.DirectionLeftToRight, null, directionViews)
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|[directionTopView]|", NSLayoutFormatOptions.DirectionLeftToRight, null, directionViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|[directionBottomView]|", NSLayoutFormatOptions.DirectionLeftToRight, null, directionViews))
                .ToArray());

            /* -- directions top view -- */

            var directionTopViews = new DictionaryViews();

            _buttons = new List <UIButton>();

            for (int i = 0; i < _buttonTitles.Length; i++)
            {
                var button = new UIButton(UIButtonType.Custom)
                {
                    TranslatesAutoresizingMaskIntoConstraints = false,
                };

                // all images except car and direction buttons are active
                button.SetImage(UIImage.FromFile(i == 0 || i == 3 ? _buttonActiveImagePaths[i] :
                                                 _buttonNonActiveImagePaths[i]), UIControlState.Normal);

                button.TintColor = UIColor.Clear.FromHex("#c14d60");

                directionTopViews.Add(_buttonTitles[i].ToLower() + "Button", button);
                directionTopView.Add(button);
                _buttons.Add(button);
            }

            // share and feedback button will highlight when touched rather than change to active
            _buttons[4].SetImage(UIImage.FromFile(_buttonActiveImagePaths[4]), UIControlState.Highlighted);
            _buttons[5].SetImage(UIImage.FromFile(_buttonActiveImagePaths[5]), UIControlState.Highlighted);

            // all gps buttons
            for (int i = 1; i < 4; i++)
            {
                _buttons[i].Tag = i;
                // each button when touched will reset other gps buttons to non active
                // and set self to active
                _buttons[i].TouchUpInside += (sender, e) =>
                {
                    var button = (sender as UIButton);
                    var index  = button.Tag;

                    // all gps buttons reset
                    for (int j = 1; j < 4; j++)
                    {
                        if (j != index)
                        {
                            _buttons[j].SetImage(UIImage.FromFile(_buttonNonActiveImagePaths[j]), UIControlState.Normal);
                        }
                    }

                    button.SetImage(UIImage.FromFile(_buttonActiveImagePaths[index]), UIControlState.Normal);
                    gpsDirectionSelection = index;
                };
            }

            // direction button
            _buttons[0].TouchUpInside += (sender, e) =>
            {
                _directionsShowing         = !_directionsShowing;
                directionBottomView.Hidden = !_directionsShowing;
                _buttons[0].SetImage(UIImage.FromFile(_directionsShowing ? _buttonActiveImagePaths[0] :
                                                      _buttonNonActiveImagePaths[0]), UIControlState.Normal);
            };

            var directionTopVerticalSeperator = new UIView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                BackgroundColor = UIColor.Clear.FromHex("#dddddd")
            };

            var directionTopHorizontalSeperator = new UIView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                BackgroundColor = UIColor.Clear.FromHex("#dddddd")
            };

            directionTopViews.Add("directionTopVerticalSeperator", directionTopVerticalSeperator);
            directionTopViews.Add("directionTopHorizontalSeperator", directionTopHorizontalSeperator);

            directionTopView.Add(directionTopVerticalSeperator);
            directionTopView.Add(directionTopHorizontalSeperator);

            directionTopView.AddConstraints(
                NSLayoutConstraint.FromVisualFormat("V:|[directionButton]|", NSLayoutFormatOptions.DirectionLeftToRight, null, directionTopViews)
                .Concat(NSLayoutConstraint.FromVisualFormat("V:|-7-[carButton]-10-|", NSLayoutFormatOptions.DirectionLeftToRight, null, directionTopViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("V:|-7-[busButton]-10-|", NSLayoutFormatOptions.DirectionLeftToRight, null, directionTopViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("V:|-7-[walkButton]-10-|", NSLayoutFormatOptions.DirectionLeftToRight, null, directionTopViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("V:|-7-[favouriteButton]-10-|", NSLayoutFormatOptions.DirectionLeftToRight, null, directionTopViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("V:|-7-[shareButton]-10-|", NSLayoutFormatOptions.DirectionLeftToRight, null, directionTopViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("V:|-10-[directionTopVerticalSeperator]-10-|", NSLayoutFormatOptions.DirectionLeftToRight, null, directionTopViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("V:[directionTopHorizontalSeperator(1)]|", NSLayoutFormatOptions.DirectionLeftToRight, null, directionTopViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|[directionButton(30)]-15-[carButton(23)]-15-[busButton(carButton)]-15-[walkButton(carButton)]-15-[directionTopVerticalSeperator(1)]", NSLayoutFormatOptions.AlignAllTop, null, directionTopViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:[favouriteButton(25)]-15-[shareButton(22)]-15-|", NSLayoutFormatOptions.AlignAllTop, null, directionTopViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|[directionTopHorizontalSeperator]|", NSLayoutFormatOptions.AlignAllTop, null, directionTopViews))
                .ToArray());

            /* -- directions top view -- */

            /* -- directions bottom view -- */

            _currentAddressTextField = new UnderlinedUITextField()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Text = "Address",
                Font = UIFont.FromName("Arial", 12f),
            };

            _destinationLabel = new UILabel()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Font = UIFont.FromName("Arial", 12f),
                Text = "Address",
            };

            var directionImageView = new UIImageView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                ContentMode = UIViewContentMode.ScaleAspectFit,
                Image       = UIImage.FromFile("direction-sign.png")
            };

            directionBottomView.Add(_currentAddressTextField);
            directionBottomView.Add(_destinationLabel);
            directionBottomView.Add(directionImageView);

            var directionBottomViews = new DictionaryViews()
            {
                { "currentAddressTextField", _currentAddressTextField },
                { "destinationLabel", _destinationLabel },
                { "directionImageView", directionImageView },
            };

            directionBottomView.AddConstraints(
                NSLayoutConstraint.FromVisualFormat("V:|-5-[currentAddressTextField]-5-[destinationLabel(currentAddressTextField)]-5-|", NSLayoutFormatOptions.DirectionLeftToRight, null, directionBottomViews)
                .Concat(NSLayoutConstraint.FromVisualFormat("V:|-5-[directionImageView]-5-|", NSLayoutFormatOptions.DirectionLeftToRight, null, directionBottomViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|-5-[directionImageView(10)]-5-[currentAddressTextField]-5-|", NSLayoutFormatOptions.AlignAllTop, null, directionBottomViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|-20-[destinationLabel]-5-|", NSLayoutFormatOptions.AlignAllTop, null, directionBottomViews))
                .ToArray());

            /* -- directions bottom view -- */

            /* -- directions panel view -- */

            var infoView = new UIView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
            };

            _progressView = new UIActivityIndicatorView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Color = UIColor.White,
            };

            Add(_mapView);
            Add(_progressView);
            Add(directionView);
            Add(infoView);

            var views = new DictionaryViews()
            {
                { "mapView", _mapView },
                { "progressView", _progressView },
                { "infoView", infoView },
                { "directionView", directionView },
            };

            var coords = new CLLocationCoordinate2D(48.857, 2.351);
            var span   = new MKCoordinateSpan(MilesToLatitudeDegrees(20), MilesToLongitudeDegrees(20, coords.Latitude));

            _mapView.Region = new MKCoordinateRegion(coords, span);

            var segmentControl = new UISegmentedControl()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
            };

            segmentControl.Layer.CornerRadius = 0;
            segmentControl.Layer.BorderWidth  = 1.5f;
            segmentControl.Layer.BorderColor  = UIColor.Clear.CGColor;
            segmentControl.BackgroundColor    = UIColor.Clear.FromHex("#f9f9f9");
            segmentControl.TintColor          = UIColor.Clear;

            var selectedTextAttributes = new UITextAttributes();

            selectedTextAttributes.TextColor = UIColor.Clear.FromHex("#c14d60");
            var unSelectedTextAttributes = new UITextAttributes();

            unSelectedTextAttributes.TextColor = UIColor.Clear.FromHex("#7a7a7a");

            //set the new text color attributes on the selected segment's title
            segmentControl.SetTitleTextAttributes(selectedTextAttributes, UIControlState.Selected);
            segmentControl.SetTitleTextAttributes(unSelectedTextAttributes, UIControlState.Normal);

            segmentControl.InsertSegment("Contact", 0, false);
            segmentControl.InsertSegment("Feedback", 1, false);
            segmentControl.SelectedSegment = 0;
            segmentControl.ValueChanged   += (sender, e) =>
            {
                var selectedSegmentId = (sender as UISegmentedControl).SelectedSegment;
                switch (selectedSegmentId)
                {
                case 0:
                    _infoTableView.Hidden = false;
                    _feedbackView.Hidden  = true;
                    break;

                case 1:
                    _infoTableView.Hidden = true;
                    _feedbackView.Hidden  = false;
                    break;
                }
            };

            /* -- feedback view -- */

            _serialDisposable = new SerialDisposable();

            _feedbackView = new UIView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Hidden = true,
            };

            var ratingLabel = new UILabel()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Font          = UIFont.FromName("Helvetica", 24f),
                TextAlignment = UITextAlignment.Right,
                Text          = "4.5",
                TextColor     = UIColor.Clear.FromHex("#c14d60")
            };

            /* -- ratings panel view -- */

            var ratingsPanel = new UIView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
            };

            var numberOfReviewsLabel = new UILabel()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                Font          = UIFont.FromName("Helvetica", 14f),
                TextColor     = UIColor.Clear.FromHex("#666666"),
                TextAlignment = UITextAlignment.Left,
                Text          = "25 Reviews",
            };

            ratingsPanel.Add(numberOfReviewsLabel);

            var ratingsPanelViews = new DictionaryViews()
            {
                { "numberOfReviewsLabel", numberOfReviewsLabel },
            };

            ratingsPanel.AddConstraints(
                NSLayoutConstraint.FromVisualFormat("V:|-20-[numberOfReviewsLabel]-5-|", NSLayoutFormatOptions.DirectionLeftToRight, null, ratingsPanelViews)
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|-5-[numberOfReviewsLabel]-5-|", NSLayoutFormatOptions.DirectionLeftToRight, null, ratingsPanelViews))
                .ToArray());

            /* -- ratings panel view -- */

            var verticalSeperator = new UIView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                BackgroundColor = UIColor.Clear.FromHex("#dddddd")
            };

            var horizontalSeperator = new UIView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false,
                BackgroundColor = UIColor.Clear.FromHex("#dddddd")
            };

            _feedbackTableView = new UITableView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false
            };

            _infoTableView = new UITableView()
            {
                TranslatesAutoresizingMaskIntoConstraints = false
            };
            _infoTableView.RegisterClassForCellReuse(typeof(HeaderTableViewCell), HeaderTableViewCell.Key);
            _infoTableView.RegisterClassForCellReuse(typeof(ContactTableViewCell), ContactTableViewCell.Key);

            _feedbackView.Add(ratingLabel);
            _feedbackView.Add(ratingsPanel);
            _feedbackView.Add(verticalSeperator);
            _feedbackView.Add(horizontalSeperator);
            _feedbackView.Add(_feedbackTableView);

            var feedbackViews = new DictionaryViews()
            {
                { "ratingLabel", ratingLabel },
                { "ratingsPanel", ratingsPanel },
                { "verticalSeperator", verticalSeperator },
                { "horizontalSeperator", horizontalSeperator },
                { "feedbackTableView", _feedbackTableView },
            };

            /* -- feedback view -- */

            infoView.Add(segmentControl);
            infoView.Add(_infoTableView);
            infoView.Add(_feedbackView);

            var infoViews = new DictionaryViews()
            {
                { "segmentControl", segmentControl },
                { "infoTableView", _infoTableView },
                { "feedbackView", _feedbackView },
            };

            View.AddConstraints(NSLayoutConstraint.FromVisualFormat("V:|[mapView][infoView]|", NSLayoutFormatOptions.DirectionLeftToRight, null, views)
                                // map view is a bit smaller than info view
                                .Concat(new NSLayoutConstraint[] { NSLayoutConstraint.Create(_mapView, NSLayoutAttribute.Height, NSLayoutRelation.Equal, infoView, NSLayoutAttribute.Height, 0.9f, 0) })
                                .Concat(NSLayoutConstraint.FromVisualFormat("V:|-5-[directionView]", NSLayoutFormatOptions.DirectionLeftToRight, null, views))
                                // direction view is a third of the map view
                                .Concat(new NSLayoutConstraint[] { NSLayoutConstraint.Create(directionView, NSLayoutAttribute.Height, NSLayoutRelation.Equal, _mapView, NSLayoutAttribute.Height, 0.35f, 0) })
                                .Concat(NSLayoutConstraint.FromVisualFormat("H:|[mapView]|", NSLayoutFormatOptions.AlignAllTop, null, views))
                                .Concat(NSLayoutConstraint.FromVisualFormat("H:|-5-[directionView]-5-|", NSLayoutFormatOptions.AlignAllTop, null, views))
                                .Concat(NSLayoutConstraint.FromVisualFormat("H:|[infoView]|", NSLayoutFormatOptions.AlignAllTop, null, views))
                                .ToArray());

            infoView.AddConstraints(
                NSLayoutConstraint.FromVisualFormat("V:|[segmentControl(35)][infoTableView]|", NSLayoutFormatOptions.DirectionLeftToRight, null, infoViews)
                .Concat(NSLayoutConstraint.FromVisualFormat("V:|[segmentControl(35)][feedbackView]|", NSLayoutFormatOptions.DirectionLeftToRight, null, infoViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|[segmentControl]|", NSLayoutFormatOptions.AlignAllTop, null, infoViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|[infoTableView]|", NSLayoutFormatOptions.AlignAllTop, null, infoViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|[feedbackView]|", NSLayoutFormatOptions.AlignAllTop, null, infoViews))
                .ToArray());

            _feedbackView.AddConstraints(
                NSLayoutConstraint.FromVisualFormat("V:|-5-[ratingLabel(40)]-5-[horizontalSeperator(1)]-5-[feedbackTableView]-5-|", NSLayoutFormatOptions.DirectionLeftToRight, null, feedbackViews)
                .Concat(NSLayoutConstraint.FromVisualFormat("V:|-5-[verticalSeperator(40)]-5-[horizontalSeperator(1)]-5-[feedbackTableView]-5-|", NSLayoutFormatOptions.DirectionLeftToRight, null, feedbackViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("V:|-5-[ratingsPanel(40)]-5-[horizontalSeperator(1)]-5-[feedbackTableView]-5-|", NSLayoutFormatOptions.DirectionLeftToRight, null, feedbackViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|-10-[ratingLabel]-5-[verticalSeperator(1)]-5-[ratingsPanel(ratingLabel)]-10-|", NSLayoutFormatOptions.AlignAllTop, null, feedbackViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|-10-[horizontalSeperator]-10-|", NSLayoutFormatOptions.AlignAllTop, null, feedbackViews))
                .Concat(NSLayoutConstraint.FromVisualFormat("H:|[feedbackTableView]|", NSLayoutFormatOptions.AlignAllTop, null, feedbackViews))
                .ToArray());

            this.Bind(ViewModel, x => x.CompanyName, x => x.Title);
            this.Bind(ViewModel, x => x.DestinationAddress, x => x._destinationLabel.Text);
            this.Bind(ViewModel, x => x.CurrentAddress, x => x._currentAddressTextField.Text);

            this.Bind(ViewModel, x => x.Phone, x => x._phoneLabel.Text);
            this.Bind(ViewModel, x => x.Email, x => x._emailLabel.Text);
            this.Bind(ViewModel, x => x.Website, x => x._websiteLabel.Text);

            this.BindCommand(ViewModel, x => x.DrivingCommand, x => x._buttons[1]);
            this.BindCommand(ViewModel, x => x.TransitCommand, x => x._buttons[2]);
            this.BindCommand(ViewModel, x => x.WalkingCommand, x => x._buttons[3]);

            this.WhenActivated(d =>
            {
            });
        }