0

I have a bunch of MapIcons defined similarly to this:

Geopoint t_pt = new Geopoint(new BasicGeoposition() { Latitude = -50.05, Longitude = 22.12 });
MapIcon t_icon = new MapIcon { Location = t_pt };
t_icon.Title ="My_Title";
MainMap.MapElements.Add(t_icon);

These display on MainMap with no problem. But I would like to add a tooltip to each MapIcon that displays, for example, the Icon title. I have tried this:

ToolTipService.SetToolTip(t_icon, "HI");

As a test but when I mouseover the MapIcon nothing is displayed. Tooltips work find if I mouseover other controls (such as a button or listbox), though.

Any ideas?

rbrundritt
  • 16,570
  • 2
  • 21
  • 46
os1
  • 412
  • 1
  • 6
  • 18

1 Answers1

1

Tool tips only work with XAML elements - a MapIcon is not a XAML UI element. You can either implement the tooltip yourself by listening to the MapPointerEntered/Exited event and displaying a XAML rectangle with text, or you can use XAML elements added to the map control as children instead of MapIcon for your pushpins (not recommended if you have a lot of items).

Duncan Lawler
  • 1,772
  • 8
  • 13