Skip to main content

BreadcrumbControl.SelectedItemTemplate Property

Gets or sets a template that defines the presentation of selected nodes and an empty item. This is a dependency property.

Namespace: DevExpress.Xpf.Controls

Assembly: DevExpress.Xpf.Controls.v24.1.dll

NuGet Package: DevExpress.Wpf.Controls

Declaration

public DataTemplate SelectedItemTemplate { get; set; }

Property Value

Type Description
DataTemplate

A template used to render selected nodes and an empty item.

Remarks

When the BreadcrumbControl functions in Items EditMode, it displays the selected items as nodes and an empty item.

The SelectedItemTemplate property allows you to specify a template for the Breadcrumb nodes and an empty item.

If you have more than one template that can be used to render breadcrumb nodes, 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 SelectedItemTemplateSelector property.

If both the SelectedItemTemplate and SelectedItemTemplateSelector are specified, the breadcrumb nodes are rendered using the template returned by the template selector. If the template selector returns null, the template specified by the SelectedItemTemplate property is used.

Example

<dxco:BreadcrumbControl 
    EmptyItemText="Start Here"
    ItemsSource="{Binding Documents}" 
    KeyMember="Id"
    ParentMember="ParentId" 
    DisplayMember="Title" 
    ImageMember="Image">
    <dxco:BreadcrumbControl.SelectedItemTemplate>
        <DataTemplate>
            <StackPanel Orientation="Horizontal">
                <Image Source="{Binding Image}" Height="16" Width="16"/>
                <TextBlock Text="{DXBinding Text}" Margin="10,0,0,0" Foreground="SeaGreen"/>
            </StackPanel>
        </DataTemplate>
    </dxco:BreadcrumbControl.SelectedItemTemplate>
</dxco:BreadcrumbControl>

The image below illustrates the result:

See Also