AccordionItem.GlyphTemplate Property

Gets or sets a template that defines the presentation of the glyph displayed within the current accordion item. This is a dependency property.

Namespace: DevExpress.Xpf.Accordion

Assembly: DevExpress.Xpf.Accordion.v20.1.dll

Declaration

public DataTemplate GlyphTemplate { get; set; }
Public Property GlyphTemplate As DataTemplate

Property Value

Type Description
DataTemplate

A DataTemplate object that is the template which defines the presentation of the accordion item's glyph.

Remarks

Specify the GlyphTemplate property to customize the accordion item's glyph. If you have more than one template that can be used to render the glyph, specify the AccordionItem.GlyphTemplateSelector property to implement custom logic for selecting the required template.

The following code sample demonstrates how to add a custom image to the root item:

<dxa:AccordionControl>
   <dxa:AccordionItem Header="Root Item" Glyph="{dx:DXImage Image=Walking_16x16.png}" GlyphPosition="Right">
      <dxa:AccordionItem.GlyphTemplate>
         <DataTemplate>
            <Border BorderThickness="1" BorderBrush="Black" Background="LightYellow">
               <Image Source="{Binding}" Margin="5"></Image>
            </Border>
         </DataTemplate>
      </dxa:AccordionItem.GlyphTemplate>
      <dxa:AccordionItem Header="SubItem" Glyph="{dx:DXImage Image=Map_16x16.png}"/>
      <dxa:AccordionItem Header="SubItem" Glyph="{dx:DXImage Image=Map_16x16.png}"/>
   </dxa:AccordionItem>
</dxa:AccordionControl>

The image below shows the result:

AccordionItemCustomizationGlyph

In the demonstrated code sample, the accordion item displays the glyph at the right side. Use the AccordionItem.GlyphPosition property to specify the glyph's position. You can specify the glyph's position for all items within the accordion control using the AccordionControl.ItemGlyphPosition property.

Refer to the Item Glyph Customization topic to learn more.

See Also