Select to view content in your preferred language

Programmatically Hide MapTip

973
3
12-06-2010 09:30 AM
DonnieHolmes
Occasional Contributor
Is there currently a way to programatically hide the maptip? I am using a maptip to contain a toolbar & I would like to hide the maptip as soon as the user clicks one of the buttons in my toolbar (rather than wait until the user mouses out).   I've made several attempts at searching the visual tree for the Popup that contains the maptip w/ no success.

Maybe it would be useful to add a HideMapTip method to the Map class?
0 Kudos
3 Replies
DonnieHolmes
Occasional Contributor
Nevermind... Easy solution.

From within my custom maptip control:

        private void Close()
        {
            ((Popup)Parent).IsOpen = false;
        }
0 Kudos
AliMirzabeigi
Emerging Contributor
In addition to your solution if you are using version 2.1 you can use InfoWindow control instead (sample here: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#InfoWindowSimple). To close a given instance of an InfoWindow you can set its "IsOpen" property to FALSE according to your application logic.
0 Kudos
DonnieHolmes
Occasional Contributor
In addition to your solution if you are using version 2.1 you can use InfoWindow control instead (sample here: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#InfoWindowSimple). To close a given instance of an InfoWindow you can set its "IsOpen" property to FALSE according to your application logic.


Funny you should mention that. I'm definitely loving the new InfoWindow.  That's actually what brought about my question. The first button in the toolbar creates an InfoWindow and anchors it to the maptip feature. It seemed funny to leave the maptip showing even after the InfoWindow was displayed.
0 Kudos