I have some code that creates a new map in a new map pane in response to a tool run by the user. A very simplified version of the code looks something like this:
await QueuedTask.Run(async() =>
myNewMap = MapFactory.Instance.CreateMap(mapName);
//Some other stuff happens with myNewMap here.....
await QueuedTask.Run(async () =>
IMapPane myNewMapPane = await ProApp.Panes.CreateMapPaneAsync(myNewMap, someOtherMapExtent);
This all seems very straight forward, but I've noticed that after a few new panes have been created, this code runs slower and slower each time another new map/pane is created. If I go and manually close all of the newly created map panes, the code goes back to running the original speed, but then slows down again as more panes are again added. Has anyone else experienced this? Any ideas how to fix this?