[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Collapse]Layout Management
   [Collapse]Dock Windows
    [Expand]Getting Started
    [Collapse]Dock Items
      Layout Groups
      Layout (Dock) Panels
      Tabbed Groups
      Document Groups and Panels
      Float Groups
      Auto-Hide Groups
      MDI Mode
    [Expand]Layout Items
    [Expand]Runtime Features
    [Expand]Miscellaneous
    [Expand]Examples
   [Expand]Tile and Layout
   [Expand]Tab Control
   [Expand]Carousel
    Book Control
    Workspace Manager
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Layout (Dock) Panels

Expanded Overview

Layout Panels (LayoutPanel objects) are regular dock panels. They can be docked, made floating or auto-hidden. Visually, a panel consists of a caption and client area that displays custom controls.

Layout panels support the following dock features:

  • They can be displayed side-by-side (vertically or horizontally) with other panels or other dock objects (to form this layout in code or XAML, you need to combine panels into a Layout Group).
  • They can be combined into a tab container, with the help of a Tabbed Group.
  • They can be made floating by using a Float Group.
  • They can be made auto-hidden by using an Auto-Hide Group.

Expanded Content

A panel's content can be either a single UIElement object, or a Layout Group, arranging your controls in a specific layout. To get or set the panel's content, use the ContentItem.Content property. To initialize this property in XAML, declare an object (a UIElement or LayoutGroup) between the LayoutPanel start and end tags.

A Layout Panel can display multiple controls. This can be accomplished by creating a Layout Group, and arranging your controls within this group using Layout Control Item wrappers. In this scenario, the created LayoutGroup is the root container for the layout of the controls. In code, you can access the panel's root Layout Group via the LayoutPanel.Layout property, which simply returns the value of the ContentItem.Content property, type-cast to the LayoutGroup type.

Expanded Caption and Image

To specify a caption and image for a panel, use the inherited BaseLayoutItem.Caption and BaseLayoutItem.CaptionImage properties.

Expanded Dock Operations

By default, the layout panels support all the docking features. You can disable specific features via the inherited properties: BaseLayoutItem.AllowActivate, BaseLayoutItem.AllowClose, BaseLayoutItem.AllowDock, BaseLayoutItem.AllowFloat, BaseLayoutItem.AllowHide and BaseLayoutItem.AllowRestore.

The DockLayoutManager.DockItemStartDocking, DockLayoutManager.DockItemDocking and DockLayoutManager.DockItemEndDocking events allow dock operations to be dynamically controlled.

In code, docking operations on panels can be performed via methods provided by the DockLayoutManager.DockController object.

Expanded Closed Panels

You can create a closed (hidden) panel. This can be accomplished in XAML by adding the panel to the DockLayoutManager.ClosedPanels collection. In code, you can close a panel via the DockControllerBase.Close method of the DockLayoutManager.DockController object. Closed panels can be accessed by an end-user via the Closed Panels bar, whose visibility is controlled by the DockLayoutManager.ClosedPanelsBarVisibility property. To restore a closed panel in code, use the DockController.Restore or DockController.Dock method.

Expanded Examples

Expanded See Also

Is this topic helpful?​​​​​​​