Back to Devexpress

GalleryItem.Caption Property

wpf-devexpress-dot-xpf-dot-bars-dot-galleryitem-2deb604e.md

latest4.7 KB
Original Source

GalleryItem.Caption Property

Gets or sets the gallery item’s caption. This is a dependency property.

Namespace : DevExpress.Xpf.Bars

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

NuGet Package : DevExpress.Wpf.Core

Declaration

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

Property Value

TypeDescription
Object

An object that specifies the item’s caption.

|

Remarks

Gallery items display captions and descriptions (see GalleryItem.Description), provided that the Gallery.IsItemCaptionVisible and Gallery.IsItemDescriptionVisible properties are set to \ *true *.

To specify a template used to present the item’s caption in a custom manner, use the Gallery.ItemCaptionTemplate 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.

create-wpf-gallery-control/CS/GalleryControl_Ex/MainWindow.xaml#L29

xml
<dxb:GalleryItemGroup.Items>
    <dxb:GalleryItem Caption="Schedule" Description="Show schedule" Glyph="pack://application:,,,/Images/address-16x16.png"/>
    <dxb:GalleryItem Caption="Roles" Description="Assign roles" Glyph="pack://application:,,,/Images/role-16x16.png"/>

create-wpf-gallery-control/CS/GalleryControl_Ex/MainWindow.xaml.cs#L25

csharp
private void Gallery_ItemClick(object sender, DevExpress.Xpf.Bars.GalleryItemEventArgs e) {
    MessageBox.Show("The " + e.Item.Caption + " item has been clicked");
}

wpf-create-a-ribboncontrol/CS/RibbonControl_Ex/MainWindow.xaml.cs#L71

csharp
item.Glyph = image;
item.Caption = fontFamily.ToString();
item.Tag = fontFamily;

create-wpf-gallery-control/VB/GalleryControl_Ex/MainWindow.xaml.vb#L17

vb
Private Sub Gallery_ItemClick(ByVal sender As Object, ByVal e As DevExpress.Xpf.Bars.GalleryItemEventArgs)
    MessageBox.Show("The " & e.Item.Caption & " item has been clicked")
End Sub

wpf-create-a-ribboncontrol/VB/RibbonControl_Ex/MainWindow.xaml.vb#L64

vb
item.Glyph = image
item.Caption = fontFamily.ToString()
item.Tag = fontFamily

See Also

IsItemCaptionVisible

IsItemDescriptionVisible

ItemCaptionHorizontalAlignment

ItemCaptionMargin

ItemCaptionTemplate

ItemCaptionVerticalAlignment

Description

Glyph

HoverGlyph

GalleryItem Class

GalleryItem Members

DevExpress.Xpf.Bars Namespace