I've seen code online that is super basic that can open the Catalog pane on the Project tab. I'm curious if there is a similar way to open the Catalog pane onto the Portal tab and auto-select "My Organization".
Code is below. Can something be placed into the parameters of the Execute method?
protected override void OnClick()
{
var commandId = "esri_core_showProjectDockPane";
var iCommand = FrameworkApplication.GetPlugInWrapper(commandId) as ICommand;
if (iCommand != null)
{
iCommand.Execute(null);
}
else
{
MessageBox.Show("Command not found: " + commandId, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
Solved! Go to Solution.
This has been added for 3.6. You will be able to write code similar to:
var catalogWindow = Project.GetCatalogPane() as ICatalogWindow;
if (!catalogWindow.IsActiveWindow)
return;
var catContentType = catalogWindow.GetCurrentContentType();
if (catContentType != CatalogContentType.Portal)
{
//show the portal tab
catalogWindow.SetContentTypeAsync(CatalogContentType.Portal);
}
catalogWindow.SetSecondaryPortalContentTypeAsync(
CatalogSecondaryPortalContentType.UserOrganization);
This has been added for 3.6. You will be able to write code similar to:
var catalogWindow = Project.GetCatalogPane() as ICatalogWindow;
if (!catalogWindow.IsActiveWindow)
return;
var catContentType = catalogWindow.GetCurrentContentType();
if (catContentType != CatalogContentType.Portal)
{
//show the portal tab
catalogWindow.SetContentTypeAsync(CatalogContentType.Portal);
}
catalogWindow.SetSecondaryPortalContentTypeAsync(
CatalogSecondaryPortalContentType.UserOrganization);