Disabling a tool icon from code behind

496
1
10-15-2012 01:01 AM
JohanCarlsson
Occasional Contributor
Hi!

I've placed two tools for next and previous extent in the layer configuration toolbar. The tools work fine but I'd like to disable each button when it's not possible to go to any other extent. How would I go about setting the HitTest and opacity for an icon located here? I have a DefaultIcon defined in the code for my tool, and I've added the tool (with the same icon path) in the config file tools.xml.

The ESRI tools named RefreshLayerCommand and GoToLayerCommand have this functionality. I've been looking for the source code but I can't seem to find it.

Any pointers in the right direction would be greatly appreciated.

Regards
Johan Carlsson
0 Kudos
1 Reply
JohanCarlsson
Occasional Contributor
Sorry, the answer was right in front of me. If it would help any other beginners, just use the CanExecute handler.
0 Kudos