Skip to main content
A newer version of this page is available. .

DockLayoutManager.ClosedPanels Property

Provides access to closed panels.

Namespace: DevExpress.Xpf.Docking

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

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 ‘x’ button, the panel is closed and automatically added to the ClosedPanels collection. To create a closed (hidden) panel in XAML, add it to the ClosedPanels collection. In code, a panel can be closed via the DockControllerBase.Close method provided by the DockLayoutManager.DockController object.

An end-user can restore a panel from the closed state via the Closed Panels bar, whose visibility is controlled by the DockLayoutManager.ClosedPanelsBarVisibility property. The bar displays buttons for every closed panel in the ClosedPanels collection. Clicking any button restores the corresponding panel to its previous position. You can set the bar’s location via the DockLayoutManager.ClosedPanelsBarPosition property. To restore a panel in code, use the DockController.Restore method.

The BaseLayoutItem.AllowClose property and DockLayoutManager.DockItemClosing event allow you to prevent a panel from being closed. The BaseLayoutItem.AllowRestore property and DockLayoutManager.DockItemRestoring event can be used to prevent panels from being restored.

Example

The following example shows how to create closed (hidden) panels. To create closed panels, panel objects are added to the DockLayoutManager.ClosedPanels collection. In the example, the built-in Closed Panels bar is visible (the DockLayoutManager.ClosedPanelsBarVisibility property is set to Auto). It allows closed panels to be restored on the fly.

<dxdo:DockLayoutManager Margin="12" Name="dockManager1" ClosedPanelsBarVisibility="Auto" dxcore:ThemeManager.ThemeName="Office2007Blue">
    <dxdo:DockLayoutManager.ClosedPanels>
        <!--Create three closed (hidden) panels-->
        <dxdo:LayoutPanel x:Name="paneProperties" Caption="Properties">
            <RichTextBox />
        </dxdo:LayoutPanel>
        <dxdo:LayoutPanel x:Name="paneMessages" Caption="Messages">
            <RichTextBox />
        </dxdo:LayoutPanel>
        <dxdo:LayoutPanel x:Name="paneFindResults" Caption="Find Results">
            <RichTextBox />
        </dxdo:LayoutPanel>
    </dxdo:DockLayoutManager.ClosedPanels>

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.

See Also