IDockablePaneProvider Interface


Interface that the Revit UI will call during initialization of the user interface to gather information about add-in dockable pane windows.

Namespace: Autodesk.Revit.UI
Assembly: RevitAPIUI (in RevitAPIUI.dll) Version: 18.0.0.0 (18.2.0.13)
Since: 2014

Syntax

C#
public interface IDockablePaneProvider
Visual Basic
Public Interface IDockablePaneProvider
Visual C++
public interface class IDockablePaneProvider

Examples

Copy C#
// 
// Provider class called by Revit to provide information about the pane
// to embed.
// 
public class PaneProvider : IDockablePaneProvider
{
   public void SetupDockablePane(DockablePaneProviderData data)
   {
      // 
      // SetupDockablePane is called to collect the properties for your pane
      // including the WPF FrameworkElement used for your pane.
      // 
      // You have 2 choices when specifying the UI. 

      // The typical example is to create your element as part of this setup and pass it back as the "FrameworkElement" 
      // property of the provider Data. Most any container control will work, but we
      // we generally suggest using a descendant of the Page class:
      data.FrameworkElement = new Page();

      // 
      // A more advanced mechanism is to provided a callback that creates the UI element on demand
      // each time the containing view is created. Generally, this approach is needed for UI Elements
      // that CANNOT be cached/reused due to some underlying dependancies. A good example of this
      // is the WebBrowser control that embeds a browser window, that itself is not reusable:
      data.FrameworkElement = null;  // Set Cached element to null as we are specifying a creator. 
      data.FrameworkElementCreator = new BrowserCreator(); // set a creator to call back into. 
   }
}
Copy VB.NET
'
' Provider class called by Revit to provide information about the pane
' to embed.
'
Public Class PaneProvider
    Implements IDockablePaneProvider
    Public Sub SetupDockablePane(data As DockablePaneProviderData) Implements IDockablePaneProvider.SetupDockablePane
        ' 
        ' SetupDockablePane is called to collect the properties for your pane
        ' including the WPF FrameworkElement used for your pane.
        '
        ' You have 2 choices when specifying the UI. 


        ' The typical example is to create your element as part of this setup and pass it back as the "FrameworkElement" 
        ' property of the provider Data. Most any container control will work, but we
        ' we generally suggest using a descendant of the Page class:
        data.FrameworkElement = New Page()

        '
        ' A more advanced mechanism is to provided a callback that creates the UI element on demand
        ' each time the containing view is created. Generally, this approach is needed for UI Elements
        ' that CANNOT be cached/reused due to some underlying dependancies. A good example of this
        ' is the WebBrowser control that embeds a browser window, that itself is not reusable:
        data.FrameworkElement = Nothing
        ' Set Cached element to null as we are specifying a creator. 
        data.FrameworkElementCreator = New BrowserCreator()
        ' set a creator to call back into. 
    End Sub
End Class

See Also