wpf-devexpress-dot-xpf-dot-docking-dot-baselayoutitem-e774bd44.md
Gets or sets the layout item’s caption.
Namespace : DevExpress.Xpf.Docking
Assembly : DevExpress.Xpf.Docking.v25.2.dll
NuGet Package : DevExpress.Wpf.Docking
public object Caption { get; set; }
Public Property Caption As Object
| Type | Description |
|---|---|
| Object |
The layout item’s caption.
|
The Caption is displayed in the BaseLayoutItem‘s header.
The Caption is displayed when the item’s ShowCaption inherited property is true.
Set the LayoutGroup GroupBorderStyle property to GroupBorderStyle.Group, GroupBorderStyle.GroupBox, or GroupBorderStyle.Tabbed to display the Layout Group’s Caption.
When the BaseLayoutItem.IsTabPage is true, the Caption object is duplicated in the tab area. You can set a different tab’s Caption with the BaseLayoutItem.TabCaption property.
The following code sample sets the LayoutPanel‘s Caption and BaseLayoutItem.TabCaption properties.
<Window ...
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking">
<dxdo:DockLayoutManager>
<dxdo:LayoutGroup>
<dxdo:TabbedGroup DestroyOnClosingChildren="True" >
<dxdo:LayoutPanel
Caption="Personal"
CaptionLocation="Top"
TabCaption="Info">
...
</dxdo:LayoutPanel>
<dxdo:LayoutPanel Caption="Position" />
</dxdo:TabbedGroup>
</dxdo:LayoutGroup>
</dxdo:DockLayoutManager>
</Window>
| Property | Description |
|---|---|
| CaptionImage | Gets or sets the image displayed within the item’s Caption. This is a dependency property. |
| CaptionFormat |
Gets or sets the format string used to format the layout item’s caption. This is a dependency property.
| | CaptionLocation and CaptionHorizontalAlignment | Specify the Caption item’s position and horizontal alignment. | | CaptionTemplate and CaptionTemplateSelector | Specify the Caption appearance. | | CaptionWidth | Gets or sets the width of the item’s Caption area. This is a dependency property. |
The following code snippets (auto-collected from DevExpress Examples) contain references to the Caption 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.
<dxd:DockLayoutManager>
<dxd:LayoutGroup Name="generalLayoutGroup" GroupBorderStyle="GroupBox" ShowCaption="True" Caption="General" Orientation="Vertical">
<dxd:LayoutControlItem Name="incidentNumber" Caption="Incident Number" VerticalAlignment="Top">
<dxdo:TabbedGroup>
<dxdo:LayoutPanel Caption="WindowedDocumentUIService">
<View:MainView>
wpf-docklayoutmanager-dock-panels-in-code/CS/DockPanelInCode_Ex/Window1.xaml#L18
x:Name="paneOutput"
Caption="Output"
ItemWidth="250">
wpf-dock-layout-manager-pin-unpin-layout-panels-in-mvvm/CS/App.xaml#L10
<Style TargetType="{x:Type dxd:DocumentPanel}">
<Setter Property="Caption" Value="{Binding Caption}" />
<Setter Property="CaptionImage" Value="{Binding Glyph}" />
wpf-dock-layout-manager-save-and-restore-the-dock-layout-managers-layout/CS/MainWindow.xaml#L16
<dxdo:LayoutGroup Name="root">
<dxdo:LayoutPanel Name="panel1" Caption="Panel1" ItemWidth="3*">
<dxg:GridControl Name="grid">
new Uri(@"CustomWindows\UserControl1.xaml", UriKind.Relative));
panel1.Caption = "Document " + (ctr++).ToString();
wpf-dock-layout-manager-save-and-restore-the-dock-layout-managers-layout/CS/MainWindow.xaml.cs#L22
panel.Name = "panel4";
panel.Caption = "Panel4";
manager.DockController.Dock(panel, root, DockType.Right);
panel1 = Me.dockLayoutManager1.DockController.AddDocumentPanel(Me.documentGroup1, New Uri("CustomWindows\UserControl1.xaml", UriKind.Relative))
panel1.Caption = "Document " & Math.Min(Threading.Interlocked.Increment(ctr), ctr - 1).ToString()
Call DocumentPanel.SetMDISize(panel1, New Size(400, 300))
See Also