What is the best way to change the active tab to a custom tab when a custom add-in is loaded?
Use case: The custom add-in will be part of a Pro project that is on a server. When the user opens the project, the tab they should see is the custom tab. 99% of operations they will be doing will be through tools on this tab. Since the Pro project is on a server, the add-in will not affect the user’s normal local Pro settings (particularly that the “Map” tab is the first active tab.
I have <insertModule autoLoad="true"> so the module code is running when the project with the add-in opens. I have set the custom tab as the first tab from the left using <tab insert="before" placeWith="esri_mapping_homeTab">
It seems to work to set the active tab using FrameworkApplication.ActivateTab("my_tab_id"), but I am having trouble finding the event to subscribe to.
I have tried ProjectOpenedEvent.Subscribe(), but the Ribbon does not seem to be initialized when that event fires.
I have also tried ActivePaneInitializedEvent.Subscribe(). Running FrameworkApplication.ActivateTab("my_tab_id") from that event sets the custom tab as active briefly, but eventually another event switches the active tab back to the esri_mapping_homeTab.
I have looked through the other events and am not seeing a better one to subscribe to.
Without running FrameworkApplication.ActivateTab("my_tab_id"), just having the custom tab as the first from the left makes it the active tab for a few seconds before esri_mapping_homeTab becomes active, so maybe there is a way to override the event that changes the active tab to esri_mapping_homeTab?