ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Core Namespace / LayoutFrameworkExtender Class / FindLayoutPanes Method
Does not need to be specified.
Layout
Example

In This Topic
    FindLayoutPanes Method
    In This Topic
    Find the layout panes that reference a specific layout.
    Syntax
    public static IList<ILayoutPane> FindLayoutPanes( 
       PaneCollection paneCollection,
       Layout layout
    )
    Public Shared Function FindLayoutPanes( _
       ByVal paneCollection As PaneCollection, _
       Optional ByVal layout As Layout _
    ) As IList(Of ILayoutPane)

    Parameters

    paneCollection
    Does not need to be specified.
    layout
    Layout

    Return Value

    Example
    LayoutView_FindAndCloseLayoutPanes
    //Find and close all layout panes associated with a specific layout.
    
    LayoutProjectItem findLytItem = Project.Current.GetItems<LayoutProjectItem>().FirstOrDefault(item => item.Name.Equals("Layout"));
    Layout findLyt = await QueuedTask.Run(() => findLytItem.GetLayout());  //Perform on the worker thread
    
    var panes = ProApp.Panes.FindLayoutPanes(findLyt);
    foreach (Pane pane in panes)
    {
      ProApp.Panes.CloseLayoutPanes(findLyt.URI);  //Close the pane
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also