Select to view content in your preferred language

How to place Identify in the toolbar

870
2
03-04-2011 12:15 PM
DonFreeman
Emerging Contributor
I am trying to put the Identify function in the toolbar using the sample at http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#Identify . I can get it to work OK with the function placed directly in the MouseClick event of the map, but now I want to turn it on and off using the toolbar buttons. So how would I complete the syntax in the third line of:
case 0: // Identify
 _toolMode = "identify";
 MyMap.MouseClick += QueryPoint_MouseClick() ;
 break;

It seems that the parameters need to be included somehow.
Thanks
0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
Should work the way you did it.
Just remove the handler in all other cases:
MyMap.MouseClick -= QueryPoint_MouseClick;
switch (e.Index)
{
    case 0: // Identify
     MyMap.MouseClick += QueryPoint_MouseClick;
     break;

What kind of issue do you get?
0 Kudos
DonFreeman
Emerging Contributor
Thanks dbroux. It does work. I was thinking I had to pass the args when I turned it on but apparently not.
0 Kudos