ArcGIS Pro 3.7 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 Function Find( _
       ByVal id As String _
    ) As DockPane
    public DockPane Find( 
       string id
    )

    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. If 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 its DAML id
    var pane = FrameworkApplication.DockPaneManager.Find(dockPaneID);
    Dockpane operations
    {
      // in order to find a dockpane you need to know its DAML id
      pane = FrameworkApplication.DockPaneManager.Find(dockPaneID);
    
      // 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 its DAML id
      pane = FrameworkApplication.DockPaneManager.Find(dockPaneID);
    
      // get the undo stack
      OperationManager manager = pane.OperationManager;
      if (manager != null)
      {
        // undo an operation
        // Use await with UndoAsync and RedoAsync
        if (manager.CanUndo)
          manager.UndoAsync().Wait();
    
        // redo an operation
        if (manager.CanRedo)
          manager.RedoAsync().Wait();
    
        // 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
    {
      // 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>
    
      DockpaneViewModel vm = FrameworkApplication.DockPaneManager.Find(dockPaneID) as DockpaneViewModel;
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also