Draw Object and Focus

606
2
03-16-2012 06:49 AM
KurtisGolding
New Contributor
I am having a little trouble with the Draw object in a case where the map is used in conjunction with a few other apps in a Docking panel. We have some shared commands that can be executed on any one of the active applications. However, when the Draw object is "active" it does capture all mouse movement and this causes a focus shift from an "active" application to the map.

I was trying to find a way to "start" the draw mode on something like a mouse down event.. I have tried a few ways to get around this, but it appears that Draw object does the following when enabled:

- Captures the Mouse Events
- Waits for the Mouse down event to start drawing..

I think the behavior I am looking for would be more like the following:

- Wait for mouse down
- Monitor Mouse
- Begin Draw

(If it is doing the 2nd sequence, then my issue might be somewhere else :))

Thanks for any ideas..
0 Kudos
2 Replies
JenniferNery
Esri Regular Contributor
You can disable draw (draw.IsEnabled=false) on Map.LostFocus and enable draw (draw.IsEnabled=true) on Map.GotFocus. Draw subscribes to these mouse events when activated.
0 Kudos
KurtisGolding
New Contributor
Thanks for the suggestion! I tried a number of different approaches, including toggling the enabled flag on GoFocus/LostFocus events, but so far I have not been successful in getting the behavior I would like in this use case. In this case, I would like focus of the map application to remain un-changed until the map is addressed, in this case, that would be on the mouse down event.
0 Kudos