Back to Devexpress

BaseLayoutItem.Caption Property

wpf-devexpress-dot-xpf-dot-docking-dot-baselayoutitem-e774bd44.md

latest8.5 KB
Original Source

BaseLayoutItem.Caption Property

Gets or sets the layout item’s caption.

Namespace : DevExpress.Xpf.Docking

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

NuGet Package : DevExpress.Wpf.Docking

Declaration

csharp
public object Caption { get; set; }
vb
Public Property Caption As Object

Property Value

TypeDescription
Object

The layout item’s caption.

|

Remarks

The Caption is displayed in the BaseLayoutItem‘s header.

Availability

The Caption is displayed when the item’s ShowCaption inherited property is true.

In Layout Groups

Set the LayoutGroup GroupBorderStyle property to GroupBorderStyle.Group, GroupBorderStyle.GroupBox, or GroupBorderStyle.Tabbed to display the Layout Group’s Caption.

Tabbed Group Captions

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.

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

Customize Captions

PropertyDescription
CaptionImageGets 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.

wpf-dock-layout-manager-limit-layout-group-customization-at-runtime/CS/DXDockingForLayoutPurposes/MainWindow.xaml#L21

xml
<dxd:DockLayoutManager>
    <dxd:LayoutGroup Name="generalLayoutGroup" GroupBorderStyle="GroupBox" ShowCaption="True" Caption="General" Orientation="Vertical">
        <dxd:LayoutControlItem Name="incidentNumber" Caption="Incident Number" VerticalAlignment="Top">

wpf-docklayoutmanager-use-services-that-implement-the-idocumentmanagerservice/CS/DXDocumentUIServiceSample/MainWindow.xaml#L17

xml
<dxdo:TabbedGroup>
    <dxdo:LayoutPanel Caption="WindowedDocumentUIService">
        <View:MainView>

wpf-docklayoutmanager-dock-panels-in-code/CS/DockPanelInCode_Ex/Window1.xaml#L18

xml
x:Name="paneOutput"
Caption="Output"
ItemWidth="250">

wpf-dock-layout-manager-pin-unpin-layout-panels-in-mvvm/CS/App.xaml#L10

xml
<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

xml
<dxdo:LayoutGroup Name="root">
    <dxdo:LayoutPanel Name="panel1" Caption="Panel1" ItemWidth="3*">
        <dxg:GridControl Name="grid">

wpf-docklayoutmanager-load-an-external-window-or-usercontrol-into-a-documentpanel/CS/DocumentPanel_Content/MainWindow.xaml.cs#L27

csharp
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

csharp
panel.Name = "panel4";
panel.Caption = "Panel4";
manager.DockController.Dock(panel, root, DockType.Right);

wpf-docklayoutmanager-load-an-external-window-or-usercontrol-into-a-documentpanel/VB/DocumentPanel_Content/MainWindow.xaml.vb#L34

vb
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

TabCaption

HasCaption

CaptionTemplate

BaseLayoutItem Class

BaseLayoutItem Members

DevExpress.Xpf.Docking Namespace