public override void DisplayPoiInfo(Object modelObject, bool isPinned)
        {
            m_model = modelObject as ExampleApp.SearchResultModelCLI;
            m_categoryIcon.Source = StartupResourceLoader.GetBitmap(SearchResultCategoryMapper.GetIconImageName(m_model.Category));

            m_closing = false;

            Title   = m_model.Title;
            Country = m_model.Subtitle;

            m_isPinned = isPinned;

            ShowAll();
        }
        public override void DisplayPoiInfo(Object modelObject, bool isPinned)
        {
            ExampleApp.SearchResultModelCLI model = modelObject as ExampleApp.SearchResultModelCLI;

            m_closing = false;

            TitleText = model.Title;
            //AddressText = model.Subtitle.Replace(",", Environment.NewLine);
            //PhoneText = ;
            HumanReadableCategoriesText = string.Join(Environment.NewLine, model.HumanReadableCategories) + model.Category;
            ReviewText   = model.Subtitle;
            CategoryIcon = StartupResourceLoader.GetBitmap(SearchResultCategoryMapper.GetIconImageName(model.Category));

            m_isPinned = isPinned;
            OnPropertyChanged("IsPinned");

            ShowAll();
        }
Beispiel #3
0
        public override void DisplayPoiInfo(Object modelObject, bool isPinned)
        {
            ExampleApp.SearchResultModelCLI model = modelObject as ExampleApp.SearchResultModelCLI;

            YelpResultModel yelpResultModel = YelpResultModel.FromResultModel(model);

            m_closing = false;

            TitleText   = model.Title;
            AddressText = model.Subtitle.Replace(", ", Environment.NewLine);
            PhoneText   = yelpResultModel.Phone;
            HumanReadableCategoriesText = string.Join(Environment.NewLine, model.HumanReadableCategories);
            ReviewText             = string.Join(Environment.NewLine, yelpResultModel.Reviews);
            CategoryIcon           = StartupResourceLoader.GetBitmap(SearchResultCategoryMapper.GetIconImageName(model.Category));
            PoiViewRatingCountText = yelpResultModel.ReviewCount.ToString();
            RatingsImage           = null;

            if (yelpResultModel.ReviewCount > 0 && !string.IsNullOrEmpty(yelpResultModel.RatingsImageUrl))
            {
                RatingsImage = new BitmapImage(ViewHelpers.MakeUriForImage(string.Format("{0}.png", yelpResultModel.RatingsImageUrl)));
            }

            RatingCountVisibility = string.IsNullOrEmpty(yelpResultModel.ImageUrl) && !string.IsNullOrEmpty(yelpResultModel.RatingsImageUrl) && yelpResultModel.ReviewCount > 0 ? Visibility.Visible : Visibility.Collapsed;
            Url = yelpResultModel.WebUrl;

            if (string.IsNullOrEmpty(ReviewText))
            {
                m_reviewsIcon.Visibility = Visibility.Hidden;
            }
            else
            {
                m_reviewsIcon.Visibility = Visibility.Visible;
            }

            m_poiImage.Source = new BitmapImage(new Uri("/ExampleAppWPF;component/Assets/poi_placeholder.png", UriKind.Relative));

            m_isPinned = isPinned;
            OnPropertyChanged("IsPinned");

            ShowAll();
        }