ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Framework Namespace / DockPaneManager Class / Find Method
The DAML identifier.
Example

In This Topic
    Find Method (DockPaneManager)
    In This Topic
    Returns the specified ArcGIS.Desktop.Framework.Contracts.DockPane. Instantiates the DockPane if necessary.
    Syntax
    public DockPane Find( 
       string id
    )
    Public Function Find( _
       ByVal id As String _
    ) As DockPane

    Parameters

    id
    The DAML identifier.

    Return Value

    Returns the dock pane associated with the specified DAML ID.
    Remarks
    Dock panes are singletons: there is never more than one instance of a particular dock pane and once created, they are not destroyed until the application shuts down. Use this function to access a specific dock pane. Of the dock pane doesn't exist in the collection, it will be created. Use IsDockPaneCreated to check if a dock pane already exists and IsVisible to determine a dock pane's visibility, neither of these functions will create the dock pane if it doesn't exist.
    Example
    Find a dockpane
    // in order to find a dockpane you need to know it's DAML id
    var pane = FrameworkApplication.DockPaneManager.Find("esri_core_ProjectDockPane");
    
    Dockpane properties and methods
    // in order to find a dockpane you need to know it's DAML id
    var pane = FrameworkApplication.DockPaneManager.Find("esri_core_ProjectDockPane");
    
    // determine visibility
    bool visible = pane.IsVisible;
    
    // activate it
    pane.Activate();
    
    // determine dockpane state
    DockPaneState state = pane.DockState;
    
    // pin it
    pane.Pin();
    
    // hide it
    pane.Hide();
    
    Dockpane undo / redo
    // in order to find a dockpane you need to know it's DAML id
    var pane = FrameworkApplication.DockPaneManager.Find("esri_core_contentsDockPane");
    
    // get the undo stack
    OperationManager manager = pane.OperationManager;
    if (manager != null)
    {
      // undo an operation
      if (manager.CanUndo)
        await manager.UndoAsync();
    
      // redo an operation
      if (manager.CanRedo)
        await manager.RedoAsync();
    
      // clear the undo and redo stack of operations of a particular category
      manager.ClearUndoCategory("Some category");
      manager.ClearRedoCategory("Some category");
    }
    Find a dockpane and obtain its ViewModel
    // in order to find a dockpane you need to know it's DAML id.  
    
    // Here is a DAML example with a dockpane defined. Once you have found the dockpane you can cast it
    // to the dockpane viewModel which is defined by the className attribute. 
    // 
    //<dockPanes>
    //  <dockPane id="MySample_Dockpane" caption="Dockpane 1" className="Dockpane1ViewModel" dock="bottom" height="5">
    //    <content className="Dockpane1View" />
    //  </dockPane>
    //</dockPanes>
    
    Dockpane1ViewModel vm = FrameworkApplication.DockPaneManager.Find("MySample_Dockpane") as Dockpane1ViewModel;
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also