Back to Devexpress

BreadcrumbControl.ItemTemplate Property

wpf-devexpress-dot-xpf-dot-controls-dot-breadcrumbcontrol-5f7d3eb5.md

latest3.0 KB
Original Source

BreadcrumbControl.ItemTemplate Property

Gets or sets a template that defines the presentation of items contained within the drop-down list. This is a dependency property.

Namespace : DevExpress.Xpf.Controls

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

NuGet Package : DevExpress.Wpf.Controls

Declaration

csharp
public DataTemplate ItemTemplate { get; set; }
vb
Public Property ItemTemplate As DataTemplate

Property Value

TypeDescription
DataTemplate

A DataTemplate object that represents the template which defines the presentation of items contained within the drop-down list.

|

Remarks

Use the ItemTemplate property to customize the layout and appearance of the items displayed within the nodes’ popups.

If you have more than one template that can be used to render items, you can implement custom logic to choose the required template. To do this, derive from the DataTemplateSelector class, implement the SelectTemplate method that returns a template which meets the required condition, and assign it to the ItemTemplateSelector property.

If both the ItemTemplate and ItemTemplateSelector are specified, task contents are rendered using the template returned by the template selector. If the template selector returns null , the template specified by the ItemTemplate property is used.

Example

xaml
<Window ... 
    xmlns:dxco="http://schemas.devexpress.com/winfx/2008/xaml/controls">
...
<dxco:BreadcrumbControl 
    ItemsSource="{Binding Documents}" 
    KeyMember="Id"
    ParentMember="ParentId" 
    DisplayMember="Title">
    <dxco:BreadcrumbControl.ItemTemplate>
        <DataTemplate>
            <StackPanel Orientation="Horizontal">
                <Image Source="{Binding Image}"/>
                <TextBlock Text="{Binding Text}" Margin="10,0,0,0"/>
            </StackPanel>
        </DataTemplate>
    </dxco:BreadcrumbControl.ItemTemplate>
</dxco:BreadcrumbControl>

See Also

BreadcrumbControl Class

BreadcrumbControl Members

DevExpress.Xpf.Controls Namespace