Пример #1
0
        public void PopulateWithData(Place place)
        {
            var coffeeFilterViewModel = ServiceContainer.Resolve <CoffeeFilterViewModel>();

            DistanceLabel.Text = CoffeeFilterViewModel.GetDistanceToPlace(place, coffeeFilterViewModel.Position);

            if (place.Rating != 0)
            {
                RatingLabel.Text    = place.Rating.ToString();
                StarImageView.Image = UIImage.FromBundle("i_star");
            }
            else
            {
                RatingLabel.Hidden   = true;
                StarImageView.Hidden = true;
            }

            placeButton.SetTitle(place.Name, UIControlState.Normal);
        }
Пример #2
0
        public override void Awake(NSObject context)
        {
            viewModel = ServiceContainer.Resolve <DetailsViewModel> ();

            RatingLabel.SetText(viewModel.Place.Rating.ToString());
            DistanceLabel.SetText(CoffeeFilterViewModel.GetDistanceToPlace(viewModel.Place, viewModel.Position));
            PlaceNameLabel.SetText(viewModel.Place.Name);

            SetMapRegion();
            AddMapAnnotation();
            EnableButtons(false);
            UpdatePlaceInfo();

                        #if !DEBUG
            Xamarin.Insights.Track("AppNav", new Dictionary <string, string> {
                { "page", "details" },
                { "name", viewModel.Place.Name }
            });
                        #endif
        }