Reputation: 1
This the way I've removed the unwanted tab in ConfigurationManager1.cs
:
protected override void OnUpdateDatabase(XDocument database)
{
base.OnUpdateDatabase(database);
// Get the namespace of the root element
var nsp = database.Root.Name.Namespace;
// Retrieve all tab elements from the database
var tabElements = database.Root.Descendants(nsp + "tab").ToList();
// Create a list to store elements to be removed
var elementsToRemove = new List<XElement>();
// Iterate through each tab element
foreach (var tabElement in tabElements)
{
// Get the id attribute value of the current tab element
var id = tabElement.Attribute("id")?.Value;
// Check if the tab is the "Add-In" tab or not the custom tab
if (id == "esri_core_AddInsTab" || id != "Project_Learning_Tab1")
{
// Add the tab element to the list of elements to be removed
elementsToRemove.Add(tabElement);
}
}
// Remove each element from the database
foreach (var element in elementsToRemove)
{
element.Remove();
}
}
I have tried to avoid removing the default tabs of arcgis pro and only show my custom tool tab. I've succeeded in avoiding all the other tabs except the add-in tab.
Upvotes: 0
Views: 33