Select to view content in your preferred language

DrawCompleteEvent seems to change selected item in Table of Contents to the map

446
2
Jump to solution
08-16-2023 08:58 AM
IanBaca2
Emerging Contributor

I'm trying to implement the use of the DrawCompleteEvent to force waiting to add some new layers. It seems that when the method called by the DrawCompleteEvent finishes, the Table Of Contents selection changes to the map.  I would like the selection to remain on whatever is currently selected and not change at all.  Stepping thru my code I find no place where I specifically change the TOC Selection. Additionally,  I can call the same methods with a different event, OnCameraChanged, and the table of contents selection does not change.  Is this expected behavior for the DrawCompleteEvent? Is there a way to make this not occur?

0 Kudos
1 Solution

Accepted Solutions
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Your business login in the implementation of DrawCompleteEvent is causing the selection in the TOC to change.   In order to help you we need to know what your code does.   Try to eliminate sections of your code to try to pinpoint the cause of the problem. 

View solution in original post

0 Kudos
2 Replies
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Your business login in the implementation of DrawCompleteEvent is causing the selection in the TOC to change.   In order to help you we need to know what your code does.   Try to eliminate sections of your code to try to pinpoint the cause of the problem. 

0 Kudos
IanBaca2
Emerging Contributor

You are correct. It was a call to ArcGIS.Desktop.Mapping.Map.RemoveLayers( with an empty layer list) that was doing the TOC refocusing from a layer to the map. I guess I just had to believe it wasn't the event to find the real issue. Thanks for the reply. 

0 Kudos