Back to Devexpress

BaseLayoutItem.CaptionImage Property

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

latest5.9 KB
Original Source

BaseLayoutItem.CaptionImage Property

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

Declaration

csharp
public ImageSource CaptionImage { get; set; }
vb
Public Property CaptionImage As ImageSource

Property Value

TypeDescription
ImageSource

An ImageSource object that specifies the image displayed within the item’s Caption.

|

Remarks

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.

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

wpf-dock-layout-manager-serialize-custom-panels-and-their-properties/CS/DX_WPF_Application10/MainWindow.xaml#L21

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

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

xml
<Setter Property="Caption" Value="{Binding Caption}" />
    <Setter Property="CaptionImage" Value="{Binding Glyph}" />
</Style>

See Also

Caption

ShowCaptionImage

DefaultAutoHidePanelCaptionImage

DefaultTabPageCaptionImage

BaseLayoutItem Class

BaseLayoutItem Members

DevExpress.Xpf.Docking Namespace