I am trying to create a new Map pane (with a new map in it) but keep the current layout pane I am on active. When I run these lines:
string mapName = $"{Name} Map";
Map newMap = await QueuedTask.Run(() => MapFactory.Instance.CreateMap(mapName));
Pane layoutPane = ProApp.Panes.ActivePane;
await ProApp.Panes.CreateMapPaneAsync(newMap);
layoutPane.Activate();
I see the new pane get created and start initializing, then the layout is selected, then the new pane is re-selected (presumably when it finishes initializing). What do I need to do to come out of this code with the layout as my active pane?