public void Display(string title, string description, string imagePath)
        {
            Visibility = Visibility.Visible;

            m_titleView.Text       = title;
            m_descriptionView.Text = description;

            if (imagePath.Length > 0)
            {
                StartupResourceLoader.LoadImage(imagePath);
                var src = StartupResourceLoader.GetBitmap(imagePath);

                if (src != null)
                {
                    m_imageView.Source       = src;
                    m_imageHeader.Visibility = Visibility.Visible;
                    m_imageView.Visibility   = Visibility.Visible;
                }
                else
                {
                    m_imageHeader.Visibility = Visibility.Hidden;
                    m_imageView.Visibility   = Visibility.Hidden;
                }
            }
            else
            {
                m_imageHeader.Visibility = Visibility.Hidden;
                m_imageView.Visibility   = Visibility.Hidden;
            }

            m_currentWindow.DisableInput();
        }
        public static BitmapImage GetIconForTag(string tagName)
        {
            var iconImagePath = string.Format("icon1_{0}.png", tagName);

            StartupResourceLoader.LoadImage(iconImagePath);
            var image = StartupResourceLoader.GetBitmap(iconImagePath);

            Debug.Assert(image != null, string.Format("unable to load image for {0}", tagName));

            return(image);
        }
        public static BitmapImage GetIconForCategory(string categoryName)
        {
            var iconImagePath = string.Format("SearchResultPoiView/{0}.png", categoryName);

            StartupResourceLoader.LoadImage(iconImagePath);
            var image = StartupResourceLoader.GetBitmap(iconImagePath);

            Debug.Assert(image != null, string.Format("unable to load image for {0}", categoryName));

            return(image);
        }
Esempio n. 4
0
        public static BitmapImage GetIconForTag(string tagName, bool isInKioskmode)
        {
            string scaleTag      = isInKioskmode ? "@1.5x" : "";
            var    iconImagePath = string.Format("icon1_{0}{1}.png", string.IsNullOrEmpty(tagName) ? "misc" : tagName, scaleTag);

            StartupResourceLoader.LoadImage(iconImagePath);
            var image = StartupResourceLoader.GetBitmap(iconImagePath);

            Debug.Assert(image != null, string.Format("unable to load image for {0}", tagName));

            return(image);
        }
Esempio n. 5
0
        private ImageSource GetImageAssetSource(string imageAssetUrl)
        {
            string imageAssetPlusExtension = imageAssetUrl + ".png";
            var    src = StartupResourceLoader.GetBitmap(imageAssetPlusExtension);

            if (src == null)
            {
                StartupResourceLoader.LoadImage(imageAssetPlusExtension);
                src = StartupResourceLoader.GetBitmap(imageAssetPlusExtension);
            }

            return(src);
        }
        private void TransitionToNewImage()
        {
            string imageAssetPlusExtension = m_imageAssetUrl + ".png";
            var    src = StartupResourceLoader.GetBitmap(imageAssetPlusExtension);

            if (src == null)
            {
                StartupResourceLoader.LoadImage(imageAssetPlusExtension);
                src = StartupResourceLoader.GetBitmap(imageAssetPlusExtension);
            }

            m_imageView.Source = src;
        }
        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 MainWindow()
        {
            InitializeComponent();

            StartupResourceLoader.Init();


            m_mapImage = new MapImage();
            Loaded    += MainWindow_Loaded;
            Closed    += MainWindow_Closed;


            m_frameTimer = Stopwatch.StartNew();

            m_isInputActive = true;
        }
        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();
        }
Esempio n. 10
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();
        }
Esempio n. 11
0
        public MainWindow()
        {
            InitializeComponent();

            StartupResourceLoader.Init();


            m_mapImage = new MapImage();
            Loaded    += MainWindow_Loaded;
            Closed    += MainWindow_Closed;


            m_frameTimer = Stopwatch.StartNew();

            m_isMouseInputActive = true;
            m_isTouchInputActive = true;

            m_zeroIndexedTouchIds = new List <KeyValuePair <int, bool> >();
            m_isMouseInputActive  = true;
            m_isFullscreen        = false;
        }
        public void Show(string title, string subtitle, string ratingsImg, int reviewCount, float modality)
        {
            Visibility = Visibility.Visible;

            if (reviewCount == 0)
            {
                m_detailsView.Text = subtitle;

                if (ratingsImg.Length != 0)
                {
                    m_poiAccreditationImage.Visibility = Visibility.Visible;
                }
                else
                {
                    m_poiAccreditationImage.Visibility = Visibility.Collapsed;
                }

                m_detailsView.Visibility          = string.IsNullOrWhiteSpace(m_detailsView.Text) ? Visibility.Collapsed : Visibility.Visible;
                m_reviewImageAndNumber.Visibility = Visibility.Collapsed;
            }
            else
            {
                m_poiRatingImage.Source = StartupResourceLoader.GetBitmap(ratingsImg + ".png");
                m_reviewsCountView.Text = " (" + reviewCount.ToString() + ")";

                m_reviewImageAndNumber.Visibility  = Visibility.Visible;
                m_detailsView.Visibility           = Visibility.Collapsed;
                m_poiAccreditationImage.Visibility = Visibility.Visible;
            }

            m_titleView.Text = title;

            var targetAlpha = 1.0f - modality;

            AnimateToAlpha(targetAlpha);

            IsEnabled = targetAlpha > 0.0f ? true : false;
        }