wpf-devexpress-dot-xpf-dot-bars-dot-galleryitem-2deb604e.md
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
public object Caption { get; set; }
Public Property Caption As Object
| Type | Description |
|---|---|
| Object |
An object that specifies the item’s caption.
|
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
<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
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
item.Glyph = image;
item.Caption = fontFamily.ToString();
item.Tag = fontFamily;
create-wpf-gallery-control/VB/GalleryControl_Ex/MainWindow.xaml.vb#L17
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
item.Glyph = image
item.Caption = fontFamily.ToString()
item.Tag = fontFamily
See Also