wpf-devexpress-dot-xpf-dot-docking-dot-baselayoutitem-d75c2992.md
Gets or sets the image displayed within the item’s Caption. This is a dependency property.
Namespace : DevExpress.Xpf.Docking
Assembly : DevExpress.Xpf.Docking.v25.2.dll
NuGet Package : DevExpress.Wpf.Docking
public ImageSource CaptionImage { get; set; }
Public Property CaptionImage As ImageSource
| Type | Description |
|---|---|
| ImageSource |
An ImageSource object that specifies the image displayed within the item’s Caption.
|
You can use the BaseLayoutItem.ShowCaptionImage property to specify whether an image specified in the CaptionImage property is displayed.
The following code sample adds the Error icon to the Error List LayoutPanel.
<Window ...
xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:dxdo="http://schemas.devexpress.com/winfx/2008/xaml/docking">
<Window.Resources>
<ResourceDictionary>
<DrawingImage x:Key="xamlIcon" PresentationOptions:Freeze="true">
<DrawingImage.Drawing>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<GeometryGroup>
<EllipseGeometry
Center="10,10"
RadiusX="9"
RadiusY="4" />
<EllipseGeometry
Center="10,10"
RadiusX="4"
RadiusY="9" />
</GeometryGroup>
</GeometryDrawing.Geometry>
<GeometryDrawing.Brush>
<LinearGradientBrush>
<GradientStop Offset="0.0" Color="Blue" />
<GradientStop Offset="1.0" Color="#CCCCFF" />
</LinearGradientBrush>
</GeometryDrawing.Brush>
<GeometryDrawing.Pen>
<Pen Brush="Black" Thickness="2" />
</GeometryDrawing.Pen>
</GeometryDrawing>
</DrawingImage.Drawing>
</DrawingImage>
</ResourceDictionary>
</Window.Resources>
<dxdo:DockLayoutManager>
<dxdo:LayoutGroup>
<dxdo:TabbedGroup>
<dxdo:LayoutPanel Caption="Error List" CaptionImage="{dx:DXImage Image=Error_16x16.png}"/>
<dxdo:LayoutPanel Caption="Output" CaptionImage="{StaticResource xamlIcon}" />
<!-- ... -->
</dxdo:TabbedGroup>
</dxdo:LayoutGroup>
</dxdo:DockLayoutManager>
</Window>
The following code snippets (auto-collected from DevExpress Examples) contain references to the CaptionImage 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:LayoutGroup x:Name="group1" Orientation="Vertical" ItemWidth="3*">
<local:MyCustomPanel x:Name="panel2" Caption="MainView" ItemHeight="3*" CaptionImage="Images/Icons/MainView.png">
<dxg:GridControl AutoPopulateColumns="True" ShowBorder="False">
wpf-docklayoutmanager-use-imvvmdockingproperties-to-build-dock-ui-with-mvvm/CS/App.xaml#L11
<Setter Property="Caption" Value="{Binding Caption}" />
<Setter Property="CaptionImage" Value="{Binding Glyph}" />
</Style>
wpf-dock-layout-manager-pin-unpin-layout-panels-in-mvvm/CS/App.xaml#L11
<Setter Property="Caption" Value="{Binding Caption}" />
<Setter Property="CaptionImage" Value="{Binding Glyph}" />
</Style>
See Also