Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use ArcGIS 10.0 and ArcGIS .net SDK. I created AddIn project which contains Tool:

<Tool id="AddSearchLocationPoint"
  category="Add-In Controls"
  image="Images\insert.png" />

and DockableWindow:

<DockableWindow id="SearchDockableWindow"
  <InitialPlacement height="360" width="570" state="pinned" position="right" />

The dockableWindow contains WinForm’s HostElement which displays my WPF UserControl. Now I want to add a button to the WPF UserControl which will launch my tool. Do you know a way to raise the event which launches the tool?

share|improve this question
up vote 0 down vote accepted

Does the tool "Launch" or do you mean set it as the current tool? Maybe I'm not understanding your question.

I think you need to get an ICommandItem for your tool or button, similar to my answer here: Can you programmatically change the button image for a ESRI.ArcGIS.Desktop.AddIns.Button?

ICommandItem commandItem = ArcMap.Application.Document.CommandBars.Find(uid, true, true);
ArcMap.Application.CurrentTool = commandItem;

or if it isn't a tool, you could execute:

ICommandItem commandItem = ArcMap.Application.Document.CommandBars.Find(uid, true, true);
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.