Back to Devexpress

DockLayoutManager.ClosedPanels Property

wpf-devexpress-dot-xpf-dot-docking-dot-docklayoutmanager-699ba167.md

latest6.4 KB
Original Source

DockLayoutManager.ClosedPanels Property

Provides access to closed panels.

Namespace : DevExpress.Xpf.Docking

Assembly : DevExpress.Xpf.Docking.v25.2.dll

NuGet Package : DevExpress.Wpf.Docking

Declaration

csharp
public ClosedPanelCollection ClosedPanels { get; }
vb
Public ReadOnly Property ClosedPanels As ClosedPanelCollection

Property Value

TypeDescription
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:

xaml
<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:

xaml
<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>
csharp
DockLayoutManager1.DockController.Close(paneFindResults);
vb
DockLayoutManager1.DockController.Close(paneFindResults)

Closed Panels Bar

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

PropertyDescription
BaseLayoutItem.AllowCloseAllows you to prevent a panel from being closed.
BaseLayoutItem.AllowRestoreAllows you to prevent panels from being restored.
ClosedPanelsBarPositionSpecifies the Closed Panels bar position.
DockLayoutManager.ClosedPanelsBarVisibilitySpecifies 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
EventDescription
DockLayoutManager.DockItemClosingAllows you to prevent a panel from being closed.
DockLayoutManager.DockItemRestoringAllows you to prevent panels from being restored.
Runtime Operations

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

See Also

Close(BaseLayoutItem)

AllowClose

AllowRestore

DockItemClosing

DockItemRestoring

ClosedPanelsBarVisibility

ClosedPanelsBarPosition

ShowCloseButton

ClosingBehavior

DockLayoutManager Class

DockLayoutManager Members

DevExpress.Xpf.Docking Namespace