Skip to main content

DockLayoutManager.ClosedPanels Property

Provides access to closed panels.

Namespace: DevExpress.Xpf.Docking

Assembly: DevExpress.Xpf.Docking.v24.1.dll

NuGet Package: DevExpress.Wpf.Docking

Declaration

public ClosedPanelCollection ClosedPanels { get; }

Property Value

Type Description
ClosedPanelCollection

A ClosedPanelCollection object that contains closed panels.

Remarks

When an end-user clicks a panel’s close button (‘x’), the panel is closed and added to the ClosedPanelCollection.

Create Closed Panels

In XAML

Add a panel to the ClosedPanels collection. The following code sample displays the Closed Panels bar and adds panels to the ClosedPanelCollection:

<dx:ThemedWindow 
  ...
  xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
  xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking">
  <dxdo:DockLayoutManager ClosedPanelsBarVisibility="Auto">
    <dxdo:DockLayoutManager.ClosedPanels>
      <!--Create three closed (hidden) panels-->
        <dxdo:LayoutPanel Caption="Properties">
          <RichTextBox />
        </dxdo:LayoutPanel>
        <dxdo:LayoutPanel Caption="Messages">
          <RichTextBox />
        </dxdo:LayoutPanel>
        <dxdo:LayoutPanel Caption="Find Results">
          <RichTextBox />
        </dxdo:LayoutPanel>
    </dxdo:DockLayoutManager.ClosedPanels>
    <dxdo:LayoutGroup>
      <dxdo:LayoutPanel/>
    </dxdo:LayoutGroup>
  </dxdo:DockLayoutManager>
</dx:ThemedWindow>

View Example: How to Create Closed Hidden Panels

In Code

You can use the DockController object’s DockControllerBase.Close method.

The following code sample adds the paneFindResults LayoutPanel to the ClosedPanelCollection:

<dx:ThemedWindow 
  ...
  xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
  xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking">
  <dxdo:DockLayoutManager ClosedPanelsBarVisibility="Auto" x:Name="DockLayoutManager1">
    <dxdo:DockLayoutManager.ClosedPanels>
      <dxdo:LayoutPanel x:Name="paneProperties" Caption="Properties">
        <RichTextBox />
      </dxdo:LayoutPanel>
    </dxdo:DockLayoutManager.ClosedPanels>
    <dxdo:LayoutGroup>
      <dxdo:LayoutPanel x:Name="paneMessages" Caption="Messages">
        <RichTextBox />
      </dxdo:LayoutPanel>
      <dxdo:LayoutPanel x:Name="paneFindResults" Caption="Find Results">
        <RichTextBox />
      </dxdo:LayoutPanel>
    </dxdo:LayoutGroup>
  </dxdo:DockLayoutManager>
</dx:ThemedWindow>
DockLayoutManager1.DockController.Close(paneFindResults);

Closed Panels Bar

A user can restore a closed panel from the Closed Panels bar.

Property Description
BaseLayoutItem.AllowClose Allows you to prevent a panel from being closed.
BaseLayoutItem.AllowRestore Allows you to prevent panels from being restored.
ClosedPanelsBarPosition Specifies the Closed Panels bar position.
DockLayoutManager.ClosedPanelsBarVisibility Specifies the Closed Panels bar visibility.

Restore Closed Panels

The Closed Panels bar displays buttons for each closed panel in the ClosedPanels collection. Click a button to restore the corresponding panel to its previous position. You can set the bar’s location with the DockLayoutManager.ClosedPanelsBarPosition property.

Events
Event Description
DockLayoutManager.DockItemClosing Allows you to prevent a panel from being closed.
DockLayoutManager.DockItemRestoring Allows you to prevent panels from being restored.
Runtime Operations

Use the DockController object’s Restore(BaseLayoutItem) method to restore a panel.

See Also