ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Core Namespace / ICatalogWindow Interface / IsActiveWindow Property
Example

In This Topic
    IsActiveWindow Property
    In This Topic
    Gets whether the catalog dock pane is the active window or not
    Syntax
    bool IsActiveWindow {get;}
    ReadOnly Property IsActiveWindow As Boolean

    Property Value

    True if the catalog dock pane is the active window
    Remarks
    The catalog dock pane must be the active window in order to set the CatalogContentType. See also SetContentTypeAsync and SetSecondaryPortalContentTypeAsync
    Example
    Check if the Catalog Window is the active window
    {
      var catalogWindow = Project.GetCatalogPane() as ICatalogWindow;
      if (catalogWindow.IsActiveWindow)
      {
        //TODO - query/change catalog window content
      }
    }
    Set the catalog content type
    {
      //Gets the Catalog pane
      var catalogWindow = Project.GetCatalogPane() as ICatalogWindow;
      if (!catalogWindow.IsActiveWindow)
      {
        //catalog dockpane must be the active window
      }
    
      //Change the content to whatever is the next tab
      var catContentType = (int)catalogWindow.GetCurrentContentType();
      catContentType++;
    
      if (catContentType > (int)CatalogContentType.Favorites)
      {
        catContentType = (int)CatalogContentType.Project;
      }
    
      //Must be on the UI - no QueuedTask!
      catalogWindow.SetContentTypeAsync((CatalogContentType)catContentType);
    }
    Set the secondary portal catalog content
    {
      //Gets the Catalog pane
      var catalogWindow = Project.GetCatalogPane() as ICatalogWindow;
      if (!catalogWindow.IsActiveWindow)
      {
        //catalog dockpane must be the active window
      }
    
      var catContentType = catalogWindow.GetCurrentContentType();
      //Is portal content being shown?
      if (catContentType == CatalogContentType.Portal)
      {
        //check what is the portal content type being shown...
        var portalContentType = (int)catalogWindow.GetCurrentSecondaryPortalContentType();
        //advance to the next tab
        portalContentType++;
        if (portalContentType > (int)CatalogSecondaryPortalContentType.LivingAtlas)
        {
          portalContentType = (int)CatalogSecondaryPortalContentType.UserContent;
        }
    
        //set the secondary portal content type
        //Must be on the UI - no QueuedTask!
        catalogWindow.SetSecondaryPortalContentTypeAsync(
          (CatalogSecondaryPortalContentType)portalContentType);
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.6 or higher.
    See Also