public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            ShapeTitle title = value as ShapeTitle;
            MapItem    item;

            if (title == null)
            {
                item = value as MapItem;
            }
            else
            {
                item = title.MapShape;
            }

            if (item == null)
            {
                return(null);
            }

            var attr = item.Attributes["GDP_MD_EST"];

            if (attr == null)
            {
                return(null);
            }

            return(attr.Value);
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            ShapeTitle title = value as ShapeTitle;
            MapItem    item;

            if (title == null)
            {
                item = value as MapItem;
            }
            else
            {
                item = title.MapShape;
            }

            if (item == null)
            {
                return(null);
            }

            var attr = item.Attributes["POP_EST"];

            if (attr == null)
            {
                return(null);
            }

            return(System.Math.Round((double)attr.Value / 1000000, 2));
        }
Esempio n. 3
0
 object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value is MapItem)
     {
         ShapeTitle title = value as ShapeTitle;
         return(HotelRoomTooltipHelper.GetItemImageSource(title != null ? title.MapShape : (MapItem)value));
     }
     return(null);
 }
Esempio n. 4
0
 object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value is MapItem && targetType == typeof(Visibility))
     {
         ShapeTitle title       = value as ShapeTitle;
         string     imageSource = HotelRoomTooltipHelper.GetItemImageSource(title != null ? title.MapShape : (MapItem)value);
         return(string.IsNullOrWhiteSpace(imageSource) ? Visibility.Collapsed : Visibility.Visible);
     }
     return(null);
 }
Esempio n. 5
0
 object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value is MapItem)
     {
         MapPath path = value as MapPath;
         if (path != null)
         {
             return(HotelRoomTooltipHelper.CalculateTitle(path));
         }
         ShapeTitle title = value as ShapeTitle;
         if (title != null)
         {
             return(HotelRoomTooltipHelper.CalculateTitle(title.MapShape));
         }
     }
     return(null);
 }