DockLayoutManager.ClosedPanels Property
Provides access to closed panels.
Namespace: DevExpress.Xpf.Docking
Assembly: DevExpress.Xpf.Docking.v19.2.dll
Declaration
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>
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>
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.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ClosedPanels property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.